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
Similar to #368 I found myself needing to extract the application error code from a response with errors.
I was able to get it via the last_result_set attribute on the resource instance. However, this does seem as an undesired way to grab the application error code.
Context
For context, given a response like this one:
{
"errors": [
{
"title": "Name Validation Error",
"detail": "name - can't be used more than once per family member",
"code": "1000",
"source": {
"pointer": "/data/attributes/name"
},
"status": "422"
}
]
}
I would like to extract the application error code (see the "code: 1000" piece) from the resource errors in somewhat a similar way to:
This would allow clients to map application error codes better.
Can I please get some guidance or feedback here!? Thanks in advance! I would love to contribute as well if this is something that makes sense for the future of the project.
The text was updated successfully, but these errors were encountered:
tl;dr
Similar to #368 I found myself needing to extract the application error code from a response with errors.
I was able to get it via the
last_result_set
attribute on theresource
instance. However, this does seem as an undesired way to grab the application error code.Context
For context, given a response like this one:
I would like to extract the application error code (see the "code: 1000" piece) from the resource errors in somewhat a similar way to:
This would allow clients to map application error codes better.
Can I please get some guidance or feedback here!? Thanks in advance! I would love to contribute as well if this is something that makes sense for the future of the project.
The text was updated successfully, but these errors were encountered: