@@ -256,7 +256,7 @@ func (e *ICalClient) loadEvents(ctx context.Context, calName string, from string
256256 cal .Start , cal .End = & start , & end
257257
258258 if err := cal .Parse (); err != nil {
259- return nil , humane .New ( fmt . Sprintf ( "unable to parse iCal file %w" , err ) , "ensure the iCal file is valid and follows the iCal spec" )
259+ return nil , humane .Wrap ( err , "unable to parse iCal file" , "ensure the iCal file is valid and follows the iCal spec" )
260260 }
261261
262262 // Sort Events by start-date (makes our live easier down the line)
@@ -369,15 +369,15 @@ func (e *ICalClient) getIcalFromURL(ctx context.Context, url string) (io.ReadClo
369369 if err != nil {
370370 span .RecordError (err )
371371 span .SetStatus (codes .Error , err .Error ())
372- return nil , humane .New ( fmt .Sprintf ("failed creating request for %s: %w " , url , err ), "" )
372+ return nil , humane .Wrap ( err , fmt .Sprintf ("failed creating request for %s" , url ), "verify if URL is valid and well-formed " )
373373 }
374374
375375 client := http .DefaultClient
376376 resp , err := client .Do (req )
377377 if err != nil {
378378 span .RecordError (err )
379379 span .SetStatus (codes .Error , err .Error ())
380- return nil , humane .New ( fmt .Sprintf ("failed making request to %s: %w " , url , err ), "verify if URL exists and is accessible" )
380+ return nil , humane .Wrap ( err , fmt .Sprintf ("failed making request to %s" , url ), "verify if URL exists and is accessible" )
381381 }
382382
383383 return resp .Body , nil
0 commit comments