redhat-developer / try-in-dev-spaces-browser-extension

MIT License
0 stars 4 forks source link

Display errors on error output (not console.log) #44

Closed dkwon17 closed 1 year ago

dkwon17 commented 1 year ago

Instead of trying to catch and print errors to console, display errors in the errors tab in Google Chrome:

image

This can help make it easier to determine when the extension throws an error

To test this PR,

  1. Checkout this PR and run:

    curl https://gist.githubusercontent.com/dkwon17/b67322e741d418811864678045041003/raw/79b5fd02ea9dadeefd399f691ae844207f7d6186/gistfile1.txt | git apply

    in order to throw an error when trying to determine the GitHub project URL.

  2. Run yarn build and sideload the extension located in dist/chromium to Google Chrome

  3. Open a GitHub repo page (ex. https://github.com/redhat-developer/try-in-dev-spaces-browser-extension)

  4. Verify that the error appears in the console and the error output in chrome://extensions:

    image
image