Skip to content
Discussion options

You must be logged in to vote

Hey @egmacke,

For error responses though. The use case we have is that we're providing some callback endpoints for a third party service. That service expects error responses to come with a plain string response. Using @SetHeader solves the content-type issue, but not how it's serialised.

I see, then it makes total sense to request that.

Suggestion: Change the ErrorHttpResponse to take a body?: (object | string | number | boolean | Stream) | undefined like SuccessHttpReponse, then inject the error field if included. That way if only a string is passed in, it can be serialised as a plain string rather than getting wrapped as { message: 'string', error: undefined }

I see, it makes sense…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@egmacke
Comment options

@notaphplover
Comment options

Answer selected by egmacke
@egmacke
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants