Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Custom Error Response #82

Open
sdalezman opened this issue Oct 16, 2019 · 4 comments
Open

Custom Error Response #82

sdalezman opened this issue Oct 16, 2019 · 4 comments
Assignees
Labels

Comments

@sdalezman
Copy link

Hi -

I was looking through the library and there's currently no way to write a different error other than the html and response code that Sqreen sends.

I would like to show a custom error message on our React app when Sqreen shows an aborted request. I did notice that there were hooks in the internal package to enable those error messages, but maybe I missed it in my quick scan to be able to hook into those hooks?

I would set a custom status code in the Sqreen dashboard but that's not possible (only allows 400-599 status codes).

Thanks!

@Julio-Guerra
Copy link
Collaborator

Hi,

Thanks for your feedback. This is indeed a common feature request we have and will solve in the future (still unplanned though).

I was looking through the library and there's currently no way to write a different error other than the html and response code that Sqreen sends.

You are right. Today, you can only set the HTTP status code of the blocking Sqreen page or make it a HTTP redirection to your custom URL in the settings page)

I would like to show a custom error message on our React app when Sqreen shows an aborted request.

So we suggest for now to either:

  • redirect to your custom error page,
  • or set a custom HTTP status code (indeed in the 400-599 range) that will have the special meaning "sqreen has blocked the request" for your React app so that you can then display whatever you want.

Would it do the job for now?

@Julio-Guerra Julio-Guerra self-assigned this Oct 16, 2019
@sdalezman
Copy link
Author

Yea that makes sense! Adding the status code in that range probably makes the most sense!

@Julio-Guerra
Copy link
Collaborator

Julio-Guerra commented May 20, 2020

Hello @sdalezman
Quick update about this: better supporting API services is one of our main goals this year and we should solve this with a better solution (likely the ability to better configure the response along with information).

@sdalezman
Copy link
Author

sdalezman commented May 26, 2020 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants