You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Some Go design guidelines cleanup
Updated Pager[T] example to break out of loop on error.
Improved error handling example with real-world cases.
Fixed some formatting.
* feedback
@@ -432,10 +434,15 @@ In addition to service client types, Azure SDK APIs provide and use other suppor
432
434
{% include requirement/SHOULD id="golang-errors-wrapping" %} wrap an error with another error if it would help in the diagnosis of the underlying failure. Expect consumers to use [error helper functions](https://blog.golang.org/go1.13-errors) like `errors.As()` and `errors.Is()`.
433
435
434
436
```go
435
-
err:= xml.Unmarshal(resp.Payload, v)
436
-
if err != nil {
437
-
return fmt.Errorf("unmarshalling type %s: %w", reflect.TypeOf(v).Elem().Name(), err)
{% include requirement/MUST id="golang-errors-on-request-failed" %} return the service/operation specific error type when an HTTP request fails with an unsuccessful HTTP status code as defined by the service. For operations that do not define an error type, return the HTTP response body in string format if available, else return the `Status` string on the HTTP response.
0 commit comments