Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Failing URL to the email #82

Open
IsmailM opened this issue Feb 7, 2019 · 8 comments
Open

Add Failing URL to the email #82

IsmailM opened this issue Feb 7, 2019 · 8 comments

Comments

@IsmailM
Copy link

IsmailM commented Feb 7, 2019

Is it possible to add the URL of where the exception happens to the Exception object?

I see @exception.target but that simply points: http://localhost:3000/500 and not the actual URL where the 500 error happened...

@PedroPauloML
Copy link

Same doubt...

@richpeck
Copy link
Owner

Thanks guys, let me have a look at this - I am sure the URL exists in the class that's created

@richpeck
Copy link
Owner

The URL exists within the @exception object. I can amend the email template if required, or you can call @exception.target

@IsmailM
Copy link
Author

IsmailM commented Feb 18, 2019

Hi @richpeck,

Thanks for the reply.

I am currently using a custom template and did look through the source code for info on the @exception object.

However, @exception.target gives me the URL of the error page (e.g. /500) and not the URL where the exception occurred.

@iFalcao
Copy link

iFalcao commented May 21, 2019

@IsmailM, try @exception.request.referer

@terryyin
Copy link

If you are still struggling with this, I think the "right" place to get the URL is request.env['ORIGINAL_FULLPATH'].

I put the quote marks there is because it's probably wrong to create the Exception DB record in the controller, especially it's a show action.

@JulianC606
Copy link

If you are still struggling with this, I think the "right" place to get the URL is request.env['ORIGINAL_FULLPATH'].

I put the quote marks there is because it's probably wrong to create the Exception DB record in the controller, especially it's a show action.

Still gets /500 in case of error 500. The thing is, in my case, that if I use request.referer (or @exception.referer that points to same request object) I get the path before the error. If I use @exception.target, then it returns the error path. The thing is that is not usefull get /500, because I want to notify where the server error is thrown.

@JulianC606
Copy link

well after i search a little bit, i guess that it depends in ActionDispatcher middleware, where the request.env is created. I will guess that the middleware is dispatched when the error is already redirected to /500. So is not this gem fault of that error. But could you work on that?

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

No branches or pull requests

6 participants