Ckeditor5: Better formatting of custom errors

Created on 24 Sep 2020  路  9Comments  路  Source: ckeditor/ckeditor5

馃摑 Provide a description of the improvement

Right now an error prints like this:

It was formatted slightly better in the past because there was a period after the message

We don't have the message now but we have to separete "Read more" from the error code somehow. Some ideas:

  • CKEditorError: error-code | Read more: URL
  • CKEditorError: [error-code] Read more: URL
  • CKEditorError: error-code -> Read more: URL
  • Or something without "Read more" at all

If you'd like to see this improvement implemented, add a 馃憤 reaction to this post.

dx improvement

Most helpful comment

I've played a bit with this - I'd go with a two-line message:

error-short-id { param: 'value" } 
Read more: https://ckeditor.com/docs/ckeditor5/latest/.../#error-error-short-id 

console.log:

Selection_046

CKEditorError:

Selection_048

:+1:聽 Pros:

  • Link to documentation is always in the same position, so the "Read more" call to action stands out.
  • Optional params are close to the error id.

:-1: Cons:

  • requires a new method for console logging errors to have consistent error log formatting

All 9 comments

cc @jodator

Another thing to improve - error with params.

Another thing to improve - error with params.

I wonder if we could learn something from other projects here. Maybe there are some tricks that could improve the readability even further.

BTW, one of these things would be if we were able to shorten the URL as it obscures the view... But I guess this is not easily doable.

Custom URL shortener :wink: https://www.youtube.com/watch?v=Z57566JBaZQ.

But we could check how to improve in other repos for sure.

I've played a bit with this - I'd go with a two-line message:

error-short-id { param: 'value" } 
Read more: https://ckeditor.com/docs/ckeditor5/latest/.../#error-error-short-id 

console.log:

Selection_046

CKEditorError:

Selection_048

:+1:聽 Pros:

  • Link to documentation is always in the same position, so the "Read more" call to action stands out.
  • Optional params are close to the error id.

:-1: Cons:

  • requires a new method for console logging errors to have consistent error log formatting

It seems that 3 :+1: is enough :) Thanks!

Did you create a PR for this? I can see it's on review but I can't find any linked PR.

Did you create a PR for this? I can see it's on review but I can't find any linked PR.

OMG Sorry - I was 100% sure that the PR was created because I've updated the PR in eslint-plugin-ckeditor5-rules repository (ckeditor/eslint-plugin-ckeditor5-rules#1). PR is ready here: #8218.

Was this page helpful?
0 / 5 - 0 ratings