diff options
Diffstat (limited to 'doc/development/fe_guide/logging.md')
-rw-r--r-- | doc/development/fe_guide/logging.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/development/fe_guide/logging.md b/doc/development/fe_guide/logging.md index 30cf290fbe8..750bf95e8b2 100644 --- a/doc/development/fe_guide/logging.md +++ b/doc/development/fe_guide/logging.md @@ -22,7 +22,7 @@ Whenever a `catch(e)` exists, and `e` is something unexpected, log the details. ### What makes an error unexpected? -Sometimes a caught exception can be part of normal operations. For instance, third-party +Sometimes a caught exception can be part of standard operations. For instance, third-party libraries might throw an exception based on certain inputs. If we can gracefully handle these exceptions, then they are expected. Don't log them noisily. For example: @@ -36,7 +36,7 @@ try { } catch (e) { if (e instanceof FooSyntaxError) { // To handle a `FooSyntaxError`, we just need to instruct the user to change their input. - // This isn't unexpected, and is part of normal operations. + // This isn't unexpected, and is part of standard operations. setUserMessage(`Try writing better code. ${e.message}`); } else { // We're not sure what `e` is, so something unexpected and bad happened... @@ -50,7 +50,7 @@ try { We have a helpful `~/lib/logger` module which encapsulates how we can consistently log runtime errors in GitLab. Import `logError` from this -module, and use it as you normally would `console.error`. Pass the actual `Error` +module, and use it as you typically would `console.error`. Pass the actual `Error` object, so the stack trace and other details can be captured in the log: ```javascript |