Skip to content

Commit

Permalink
Oss 1005 change Unauthorized message (#557)
Browse files Browse the repository at this point in the history
* OSS-1005 unauthorize message

* fix test

* fix test
  • Loading branch information
fireridlle committed Nov 15, 2021
1 parent d85f9d3 commit 3e5d20f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ util.inherits(BadRequest, FaunaHTTPError)
*/
function Unauthorized(requestResult) {
FaunaHTTPError.call(this, 'Unauthorized', requestResult)
this.message = this.message +=
'. Check that endpoint, schema, port and secret are correct during client’s instantiation'
}

util.inherits(Unauthorized, FaunaHTTPError)
Expand Down
4 changes: 3 additions & 1 deletion test/client.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,9 @@ describe('Client', () => {
expect(response.description).toBeDefined()

expect(response.name).toEqual('Unauthorized')
expect(response.message).toEqual(errors[0].code)
expect(response.message).toEqual(
'unauthorized. Check that endpoint, schema, port and secret are correct during client’s instantiation'
)
expect(response.description).toEqual(errors[0].description)
})

Expand Down

0 comments on commit 3e5d20f

Please sign in to comment.