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
Expected behaviour: If an error is instanceof ApiBuilder.ApiResponse, it should work the same as if it is exactly that class.
What actually happens: If an error class is inheriting from ApiBuilder.ApiResponse, it no longer functions like a response object but instead results in an errorMessage with a JSON representation of the error.
classNotFoundErrorextendsApiBuilder.ApiResponse{constructor(message='Not found'){super(JSON.stringify({error: message}),{'Content-Type': 'application/json'},404)}}// This doesn't workthrownewNotFoundError()// This worksthrownewApiBuilder.ApiResponse(JSON.stringify({error: 'Not found'}),{'Content-Type': 'application/json'},404)// This is true, so why does it not work?console.log(newNotFoundError()instanceofApiBuilder.ApiResponse)
The text was updated successfully, but these errors were encountered:
Expected behaviour: If an error is
instanceof ApiBuilder.ApiResponse
, it should work the same as if it is exactly that class.What actually happens: If an error class is inheriting from
ApiBuilder.ApiResponse
, it no longer functions like a response object but instead results in anerrorMessage
with a JSON representation of the error.The text was updated successfully, but these errors were encountered: