Collapse scary error messages

RESOLVED FIXED

Status

developer.mozilla.org
Wiki pages
--
minor
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: shobson, Assigned: davidwalsh)

Tracking

Details

(Whiteboard: [specification][type:change])

Attachments

(2 attachments)

(Reporter)

Description

4 years ago
What feature should be changed? Please provide the URL of the feature if possible.
==================================================================================
Rather than providing highly technical error messages can we provide a friendlier message with the option to view the more technical content.

What problems would this solve?
===============================
Kumascript errors on pages can be scarey for new contributors and may be causing us to losing new contributors.

Who would use this?
===================
Everyone

What would users see?
=====================
To be determined, the Ubuntu error messages were suggested as a starting point.

What would users do? What would happen as a result?
===================================================
Users would see a smaller, friendlier message when they see error messages and hopefully not be scared off.

Is there anything else we should know?
======================================

Updated

4 years ago
Severity: normal → minor
Component: General → Wiki pages
https://hg.mozilla.org/mozilla-central/rev/c22459b75e0b
Assignee: nobody → kechang
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
(Reporter)

Comment 2

4 years ago
I think :RyanVM commented on the wrong bug. Going to contact him to make sure this finds its correct home.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Reporter)

Updated

4 years ago
Assignee: kechang → shobson
Thanks for the note - someone committed with the wrong bug number and our automated bug marking tool went astray as a result.
For anybody who stumbles upon this bug from the the commit in comment 1, the correct bug number was bug 1044963.
Hi All,

I am really sorry that I put the wrong bug number in the patch.
Please accept my apology for the inconvenience it has caused you.
I will be more careful next time.

Best regards,
Kershaw
(Reporter)

Comment 6

4 years ago
:kershaw No worries, it happens sometimes :) Everything ended up in the right place.
(Reporter)

Comment 7

4 years ago
Created attachment 8466386 [details]
error.jpg

Passing this off to :jezdez for back-end implementation and maybe a little re-factoring. 

When I looked a the KumaScript and django code I was confused about what parts of the formatting each languages was handling, both include conditional formatting based on the type of error and there is some of duplication of code right now. But maybe it makes sense to people who know the languages better.

There are a couple JavaScript functions in a different PR I want to take advantage of, so the JavaScript to hide/show the error is not in place. That means I don't want to submit the PR to master yet. 

:jezdez My work is in a PR here: https://github.com/stephaniehobson/kuma/tree/BUG-1044093-collapse-errors I have tried to indicate the work that needs to be done using HTML comments and I have include an attachment on this bug to give you an idea of what we are aiming for when it's all finished.
Flags: needinfo?(jezdez)
The `kumascript_errors` python context variable is provided by the request to KumaScript. [1] The KumaScript errors module [2] has some code to extract:

Error type
Macro (for corresponding Edit link)
Full text

into addressable items in the `kumascript_errors` dictionary. But, it doesn't pass the line and column of the error to python - only KumaScript knows about them.

So, it's easier to implement the message if we drop the line & column display from it. (Note: the "stacktrace" message will still display line numbers and the code context of errors.)

:fscholz - is that enough context for the error messages?

[1] https://github.com/mozilla/kuma/blob/master/kuma/wiki/views.py#L302-L303
[2] https://github.com/mozilla/kumascript/blob/master/lib/kumascript/errors.js
Flags: needinfo?(jezdez) → needinfo?(fscholz)
FWIW, I'm using https://developer-local.allizom.org/en-US/docs/Working_with_chrome_URLs as my local test page for this work.

If anyone needs them, I'm attaching the latest "built-in" template modules for KumaScript. You can load them into your local dev box via https://developer-local.allizom.org/en-US/docs/load/.
Created attachment 8471600 [details]
kumascript-autoload-modules.json
I am not able to test this locally right now and I don't have the time to fix my setup.
Can you attach an updated screenshot of how error messages would look like? The one Stephanie posted looks good to me.
Flags: needinfo?(fscholz)
(Reporter)

Comment 13

4 years ago
:groovecoder I really like the line numbers and don't find the offset information useful but don't let this hold up the work if it's complicated. Just remove line/column and do not add back offset if it will get this done faster :)

Comment 14

4 years ago
Commits pushed to master at https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/0a3ed628952492d4d7458f4b6dea5c43e7b59756
Fix Bug 1044093 - Friendlier Error Messages

Initial HTML for new errors, needs to be wired up to the backend.

https://github.com/mozilla/kuma/commit/0e7daac3c285c4f5e83980962d528d9c20501a60
bug 1044093 - fix ngettext pluralization code

https://github.com/mozilla/kuma/commit/86ac9e14a5f66c34bff9e7f8600e56fb562e0617
bug 1044093 - Display known information about kumascript errors, add toggle button

Complete kumascript error toggling

Fix test failures

https://github.com/mozilla/kuma/commit/574cfae866d6f138e67ac0c3e0fc4aa455e65161
Merge pull request #2688 from groovecoder/ks-error-messages-1044093

fix bug 1044093 - friendlier kumascript errors

Updated

4 years ago
Status: REOPENED → RESOLVED
Last Resolved: 4 years ago4 years ago
Resolution: --- → FIXED
I think we're getting some errors from this change?

https://rpm.newrelic.com/accounts/263620/applications/3172075/traced_errors/2089374807
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee: shobson → dwalsh
(Assignee)

Comment 16

4 years ago
Odd, looking now
(Assignee)

Updated

4 years ago
Duplicate of this bug: 1057366
(Assignee)

Comment 18

4 years ago
Fixed related bug:  https://bugzilla.mozilla.org/show_bug.cgi?id=1057366

Horrible copy/paste product within CKEditor.

Comment 19

4 years ago
Commits pushed to master at https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/f42ac078121c7563d27a6168962565fdedda34ad
Fix bug 1044093 - Provide safe macro display in kumascript error messages

https://github.com/mozilla/kuma/commit/3fdfa72da3290bed4e318a22750a07fa4799567f
Merge pull request #2702 from darkwing/1044093-error-messages

Fix bug 1044093 - Provide safe macro display in kumascript error messages

Updated

4 years ago
Status: REOPENED → RESOLVED
Last Resolved: 4 years ago4 years ago
Resolution: --- → FIXED
(Assignee)

Updated

4 years ago
Duplicate of this bug: 1057456
You need to log in before you can comment on or make changes to this bug.