Skip to content

Commit

Permalink
src: move error handling code into node_errors.cc
Browse files Browse the repository at this point in the history
Move the following code into a new node_errors.cc file and
declare them in node_errors.h for clarity and make it possible
to include them with node_errors.h.

- AppendExceptionLine()
- DecorateErrorStack()
- FatalError()
- OnFatalError()
- PrintErrorString()
- FatalException()
- ReportException()
- FatalTryCatch

And move the following definitions (declared elsewhere than
node_errors.h) to node_errors.cc:

- Abort() (in util.h)
- Assert() (in util.h)

PR-URL: #24058
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
  • Loading branch information
joyeecheung authored and targos committed Nov 6, 2018
1 parent 6b697d4 commit cb7d9f9
Show file tree
Hide file tree
Showing 12 changed files with 516 additions and 505 deletions.
1 change: 1 addition & 0 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@
'src/node_domain.cc',
'src/node_encoding.cc',
'src/node_errors.h',
'src/node_errors.cc',
'src/node_file.cc',
'src/node_http2.cc',
'src/node_http_parser.cc',
Expand Down
3 changes: 2 additions & 1 deletion src/async_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@

#include "async_wrap-inl.h"
#include "env-inl.h"
#include "node_errors.h"
#include "node_internals.h"
#include "util-inl.h"
#include "tracing/traced_value.h"
#include "util-inl.h"

#include "v8.h"
#include "v8-profiler.h"
Expand Down
3 changes: 2 additions & 1 deletion src/inspector_agent.cc
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include "inspector_agent.h"

#include "inspector_io.h"
#include "inspector/main_thread_interface.h"
#include "inspector/node_string.h"
#include "inspector/tracing_agent.h"
#include "inspector/worker_agent.h"
#include "inspector/worker_inspector.h"
#include "inspector_io.h"
#include "node/inspector/protocol/Protocol.h"
#include "node_errors.h"
#include "node_internals.h"
#include "node_url.h"
#include "v8-inspector.h"
Expand Down
Loading

0 comments on commit cb7d9f9

Please sign in to comment.