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
Seclude ServerlessError into lib/serverless-error.js #8743
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8743 +/- ##
=======================================
Coverage 87.43% 87.43%
=======================================
Files 256 257 +1
Lines 9631 9632 +1
=======================================
+ Hits 8421 8422 +1
Misses 1210 1210
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, one "general question" comment only
@@ -14,7 +14,7 @@ const Utils = require('./classes/Utils'); | |||
const Service = require('./classes/Service'); | |||
const Variables = require('./classes/Variables'); | |||
const ConfigSchemaHandler = require('./classes/ConfigSchemaHandler'); | |||
const ServerlessError = require('./classes/Error').ServerlessError; | |||
const ServerlessError = require('./serverless-error'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a general question about naming patterns for utilities/modules like that. It seems like currently we mostly have camelCase where I've also noticed some utils with kebab-case. Which one is preferred?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good question, I forgot to discuss that with you. Situation is as follows:
serverless
project since beginning practiced camelCase- In Node.js community more common was to practise kebab-case. Afaik to avoid confusion between case-sensitive and case insensitive file systems, e.g. now require'ing
serverless/lib/serverless.js
will work on case insensitive systems but will fail on case sensitive systems (with kabab-case it's less likely someone will mix filename casing in require) - Some other projects in this organization practice kebab-case
- As kebab-case felt to me as more natural and safer choice, at some point I decided to shift
serverless
gradually towards kabab-case (I didn't want to imply rename of all modules to avoid eventual breaking changes - but I think with new major we may simply rename all modules to it, to ensure same convention everywhere)
I don't have very strong opinion on that. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for detailed explanation, it makes sense to me 👍
Attributes to: #8364
Secludes
ServerlessError
fromServerless
internals implementation.This class should be accessible independently of
Serverless
, especially after general process error handling was generalized with #8726