mirror of
https://github.com/goldbergyoni/nodebestpractices.git
synced 2025-10-27 19:17:13 +08:00
Use simple quotes everywhere
This commit is contained in:
@ -13,7 +13,7 @@ Without one dedicated object for error handling, greater are the chances of impo
|
||||
// DAL layer, we don't handle errors here
|
||||
DB.addDocument(newCustomer, (error, result) => {
|
||||
if (error)
|
||||
throw new Error("Great error explanation comes here", other useful parameters)
|
||||
throw new Error('Great error explanation comes here', other useful parameters)
|
||||
});
|
||||
|
||||
// API route code, we catch both sync and async errors and forward to the middleware
|
||||
@ -45,7 +45,7 @@ app.use(async (err, req, res, next) => {
|
||||
// DAL layer, we don't handle errors here
|
||||
DB.addDocument(newCustomer, (error: Error, result: Result) => {
|
||||
if (error)
|
||||
throw new Error("Great error explanation comes here", other useful parameters)
|
||||
throw new Error('Great error explanation comes here', other useful parameters)
|
||||
});
|
||||
|
||||
// API route code, we catch both sync and async errors and forward to the middleware
|
||||
|
||||
Reference in New Issue
Block a user