Skip to content

Commit

Permalink
feat: add statusMessage as well
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Oct 27, 2022
1 parent 4092290 commit 177d62f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export function createFetchError<T = any> (request: FetchRequest, error?: Error,
Object.defineProperty(fetchError, 'response', { get () { return response } })
Object.defineProperty(fetchError, 'data', { get () { return response && response._data } })
Object.defineProperty(fetchError, 'statusCode', { get () { return response && response.status } })
Object.defineProperty(fetchError, 'statusMessage', { get () { return response && response.statusText } })

return fetchError
}

0 comments on commit 177d62f

Please sign in to comment.