Replies: 2 comments
-
Hey @j03k64 couple of things here. The Sentry wrappers aim to just send information in Sentry, and leave managing the response to the developer (no magic). In the first example, what does the handler return if you do Also, why are you manually adding |
Beta Was this translation helpful? Give feedback.
-
Thanks for that clarification @AbhiPrasad. I guess I was expecting it to be handled by Sentry, but your explanation makes sense. I've answered your questions below.
I was hacking trying to get Errors thrown in the Cheers |
Beta Was this translation helpful? Give feedback.
-
Hello, I just started playing with Sentry inside of NextJS and I have a question on what is expected.
I have a file in
src/pages/api/hello.tsx
:But, the problem is I'll get
HTML
responses vs.JSON
responses (e.g.):I've updated that handler to look like this:
So now I'll always get
JSON
responses (e.g):I guess I was expecting that
Sentry.wrapApiHandlerWithSentry
would handle whether it is an HTML request vs. API/REST request. As there doesn't appear to be a much on the web regarding this, I feel like I have something configured incorrectly or something.Any help would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions