@@ -84,11 +84,11 @@ func getProbeList(projectID string, cmd *cobra.Command, credentials types.Creden
8484 Label : "Do you want to enable advance filter probes?" ,
8585 Items : []string {"Yes" , "No" },
8686 }
87- _ , option , err := prompt .Run ()
88- if err != nil {
89- fmt . Printf ("Prompt failed %v \n " , err )
90- return
91- }
87+ _ , option , err := prompt .Run ()
88+ if err != nil {
89+ utils . PrintFormattedError ("Prompt failed" , err )
90+ return
91+ }
9292 fmt .Printf ("You chose %q\n " , option )
9393
9494 if option == "Yes" {
@@ -106,7 +106,7 @@ func getProbeList(projectID string, cmd *cobra.Command, credentials types.Creden
106106
107107 selectedIndex , result , err := prompt .Run ()
108108 if err != nil {
109- fmt . Printf ("Prompt failed %v \n " , err )
109+ utils . PrintFormattedError ("Prompt failed" , err )
110110 os .Exit (1 )
111111 }
112112
@@ -153,12 +153,12 @@ func getProbeList(projectID string, cmd *cobra.Command, credentials types.Creden
153153 if end > totalProbes {
154154 end = totalProbes
155155 }
156- for _ , probe := range probes_data [start :end ] {
157- intTime , err := strconv .ParseInt (probe .CreatedAt , 10 , 64 )
158- if err != nil {
159- fmt . Println ("Error converting CreatedAt to int64: " , err )
160- continue
161- }
156+ for _ , probe := range probes_data [start :end ] {
157+ intTime , err := strconv .ParseInt (probe .CreatedAt , 10 , 64 )
158+ if err != nil {
159+ utils . PrintFormattedError ("Error converting CreatedAt to int64" , err )
160+ continue
161+ }
162162 humanTime := time .Unix (intTime , 0 )
163163 var probeReferencedBy int
164164 if probe .ReferencedBy != nil {
@@ -201,12 +201,12 @@ func getProbeDetails(projectID, ProbeID string, credentials types.Credentials) {
201201 writer := tabwriter .NewWriter (os .Stdout , 30 , 8 , 2 , '\t' , tabwriter .AlignRight )
202202 intUpdateTime , err := strconv .ParseInt (probeGetData .UpdatedAt , 10 , 64 )
203203 if err != nil {
204- utils .Red . Println ("Error converting UpdatedAt to int64: " , err )
204+ utils .PrintFormattedError ("Error converting UpdatedAt to int64" , err )
205205 }
206206 updatedTime := time .Unix (intUpdateTime , 0 ).String ()
207207 intCreatedTime , err := strconv .ParseInt (probeGetData .CreatedAt , 10 , 64 )
208208 if err != nil {
209- utils .Red . Println ("Error converting CreatedAt to int64: " , err )
209+ utils .PrintFormattedError ("Error converting CreatedAt to int64" , err )
210210 }
211211 createdTime := time .Unix (intCreatedTime , 0 ).String ()
212212 utils .White_B .Fprintln (writer , "PROBE DETAILS" )
0 commit comments