mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 08:13:12 +09:00
Don't log print permission denied stack traces
Use PermissionError to signal when permission is denied for an action and prevent them being logged as stack traces in the master log.
This commit is contained in:
1 parent
7ecac539f9
commit
bfea6cb28e
2 files changed
+17
-2
No files matched your search
@@ -16,6 +16,16 @@ class CommandError extends Error { }
|
||||
*/
|
||||
class RequestError extends Error { }
|
||||
|
||||
/**
|
||||
* Thrown when a permission check fails.
|
||||
*
|
||||
* Is a subclass of RequestError to prevent logging stack traces when
|
||||
* requests fail due to permission denied.
|
||||
*
|
||||
* @static
|
||||
*/
|
||||
class PermissionError extends RequestError { }
|
||||
|
||||
/**
|
||||
* Signal for messages that fail validation
|
||||
* @static
|
||||
@@ -66,6 +76,7 @@ class PluginError extends Error {
|
||||
module.exports = {
|
||||
CommandError,
|
||||
RequestError,
|
||||
PermissionError,
|
||||
InvalidMessage,
|
||||
SessionLost,
|
||||
AuthenticationFailed,
|
||||
|
||||
Reference in new issue
Block a user