Skip to content
This repository was archived by the owner on Apr 23, 2019. It is now read-only.
This repository was archived by the owner on Apr 23, 2019. It is now read-only.

Middleware client should not crash app when client code is invalid #134

@irae

Description

@irae

I was during my normal developer flow, and I got a git conflict.

Git conflicts are pretty common workflow and they often break syntax. Here is what I got back:

9:20:51 AM web.1     |  [nodemon] starting `node src/server.js`
9:20:52 AM web.1     |  /Users/irae/code/consider/web-fe/fixtures/query/clauses.js:17
9:20:52 AM web.1     |  <<<<<<< HEAD
9:20:52 AM web.1     |  ^^
9:20:52 AM web.1     |  SyntaxError: Unexpected token <<
9:20:52 AM web.1     |      at Object.exports.runInThisContext (vm.js:76:16)
9:20:52 AM web.1     |      at Module._compile (module.js:542:28)
9:20:52 AM web.1     |      at Object.Module._extensions..js (module.js:579:10)
9:20:52 AM web.1     |      at Module.load (module.js:487:32)
9:20:52 AM web.1     |      at tryModuleLoad (module.js:446:12)
9:20:52 AM web.1     |      at Function.Module._load (module.js:438:3)
9:20:52 AM web.1     |      at Module.require (module.js:497:17)
9:20:52 AM web.1     |      at require (internal/module.js:20:19)
9:20:52 AM web.1     |      at Object.<anonymous> (/Users/irae/code/consider/web-fe/src/views/fixture-loader.js:4:50)
9:20:52 AM web.1     |      at Module._compile (module.js:570:32)
9:20:52 AM web.1     |      at Object.Module._extensions..js (module.js:579:10)
9:20:52 AM web.1     |      at Module.load (module.js:487:32)
9:20:52 AM web.1     |      at tryModuleLoad (module.js:446:12)
9:20:52 AM web.1     |      at Function.Module._load (module.js:438:3)
9:20:52 AM web.1     |      at Module.require (module.js:497:17)
9:20:52 AM web.1     |      at require (internal/module.js:20:19)
9:20:52 AM web.1     |  [nodemon] app crashed - waiting for file changes before starting...

I fully agree that we should log this error, and the stack is correct. But the last line shows that my server crashed with this change, which is something I would not expect to happen. It is not that bad, but workflow could be improved by console.error with colors and recovering transparently.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions