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

Normalize error messages when running with insufficient privileges #56

Closed
Nek-12 opened this issue Aug 27, 2020 · 0 comments
Closed

Normalize error messages when running with insufficient privileges #56

Nek-12 opened this issue Aug 27, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@Nek-12
Copy link
Contributor

Nek-12 commented Aug 27, 2020

problem
Currently, running notion-enhancer without root (sudo) or admin rights gives out some really cryptic and verbose messages.
solution
EACCESS exception should be handled gracefully, showing short and meaningful messages to the user without any technical experience.

See this example:

[nek@NekLinux bin]$ notion-enhancer apply
=== NOTION ENHANCEMENT LOG ===
...unpacking app.asar
### ERROR ###
Error: EACCES: permission denied, mkdir '/opt/notion-app/app'
at Object.mkdirSync (fs.js:947:3)
at Object.promisified.mkdirpSync (/usr/lib/node_modules/notion-enhancer/node_modules/asar/lib/wrapped-fs.js:24:38)
at module.exports.extractAll (/usr/lib/node_modules/notion-enhancer/node_modules/asar/lib/asar.js:177:6)
at module.exports (/usr/lib/node_modules/notion-enhancer/pkg/apply.js:60:5)
at async CAC.<anonymous> (/usr/lib/node_modules/notion-enhancer/bin.js:28:5) {
errno: -13,
syscall: 'mkdir',
code: 'EACCES',
path: '/opt/notion-app/app'
}
=== END OF LOG ===
[nek@NekLinux bin]$ sudo notion-enhancer apply
=== NOTION ENHANCEMENT LOG ===
...unpacking app.asar
...patching app launcher (notion-app linux wrappers only).
...recording enhancement version.
~~ success.
=== END OF LOG ===
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants