-
Notifications
You must be signed in to change notification settings - Fork 274
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
Better stacktrace #1049
base: main
Are you sure you want to change the base?
Better stacktrace #1049
Conversation
This looks pretty sane and useful to me - thanks for the contribution! Would like another core dev to review as well though, in particular the addition of Devel::StackTrace as a dep. Personally I have no problem with it, it does its job well, and has a short and reliable chain of deps itself: http://deps.cpantesters.org/?module=Devel%3A%3AStackTrace&perl=5.22.0&os=any+OS |
Please note, there is one thing this PR doesn't address: Hi @bigpresh, |
@vlyon Good stuff. I'm not sure about the Regarding the css file: we can also use Maybe we can introduce a way in |
@xsawyerx Most of the code has been "borrowed" from Miyagawa's Plack::Middleware::StackTrace The A few points of interest from that page:
I would be really good to make use of this middleware (when enabled) instead of bringing our own. It would require some big changes though to the way errors are thrown and caught. |
@xsawyerx Regarding
We don't want to have to create upgrade scripts for D2, this'll add really unnecessary complexity, prone to many bugs & issues.
No, this just defeats the whole purpose of providing a static file. Like you said, the file then can't be customised. There is only one place where it is being used. This is in I don't think this should be in a separate file, the CSS should be served along with the page (there isn't very much) or even in the HTML. If someone wants to customise the look, there are many ways to override the way errors are displayed. But if we want to change the way it looks, and the CSS is in a static file, then we can't, we're stuck! |
On 30/10/2015 6:45 pm, Vernon wrote:
Update <> Upgrade. It also shouldn't be automatic; an app developer I like the approach Catalyst has when updating its scripts; if the file --veryrusty |
I'm still quite scared of this change and don't feel comfortable adding it as it, at least right now. Other options:
I hope the first doesn't happen. I'm open to the second. And I think the last is the most likely one to work. What do you guys say? |
Hi @xsawyerx, I'm glad you don't want to give up on it.
|
On 29/03/16 18:45, Vernon Lyon wrote:
This won't work for paranoid types (like me) who use |
Ok, well that brings us back to using the patch as it is. Can we at least use the first commit 0e05708 in this PR? It doesn't really need the style changes in the Also my first commit actually removes inline CSS, so paranoids like @SysPete should be happy too. Once that's there I'll look at creating a new PR with the other changes if you like? |
Actually lets break this into 2 PRs.
|
I've rebased commit 6a4b8d6 against master in branch https://github.com/PerlDancer/Dancer2/tree/vlyon-better-stack-trace and am looking at what is needed to integrate this with |
Now I've played with this a little I think this PR should be closed: it does improve the stack display in the error page when running in dev mode but it does nothing for logging and exception handling in general. I think it is better to concentrate on a more complete solution as per #765 |
True, this change does nothing for logging, and yes, it makes no changes to exception handling. This happens because of the Using @SysPete Thanks for the rebase above, I've taken those changes and adjusted them slightly, 7448eec |
@vlyon agree: we still need to catch the correct error. Now I just need a few more tuits. |
Let me know if I should create a new PR from that commit. 7448eec |
@SysPete have your tuits returned? ;) In all seriousness, how can we get this one across the finish line? |
my current $work2 D2 stack includes a hack along these lines:
so I'm more interested in #765 than messing with current exceptions right now. Sadly tuits are still in rather short supply. If I manage to catch up with $work1 (TS), then I'll have another look at this PR in a few weeks |
table
instead ofpre
and shows 5 lines of context instead of almost 3. (bug fixed)response_internal_error
which makes the stacktraces completely useless currently.