-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy patherror.go
More file actions
37 lines (31 loc) · 803 Bytes
/
error.go
File metadata and controls
37 lines (31 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Nsmf_PDUSession
*
* SMF PDU Session Service
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
import (
"fmt"
"net/http"
)
// GenericOpenAPIError Provides access to the body, error and model on returned errors.
type GenericOpenAPIError struct {
RawBody []byte
ErrorStatus int
ErrorModel interface{}
}
// Error returns non-empty string if there was an error.
func (e GenericOpenAPIError) Error() string {
return fmt.Sprintf("%d, %s", e.ErrorStatus, http.StatusText(e.ErrorStatus))
}
// Body returns the raw bytes of the response
func (e GenericOpenAPIError) Body() []byte {
return e.RawBody
}
// Model returns the unpacked model of the error
func (e GenericOpenAPIError) Model() interface{} {
return e.ErrorModel
}