File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,10 @@ class CoreError extends Boom {
23
23
24
24
super ( message ? message : undefined , options ) ;
25
25
26
- if ( typeof message === 'string' || ! this . isServer ) {
26
+ if (
27
+ ( typeof message === 'string' || ! this . isServer ) &&
28
+ ctr . name !== CoreError . name
29
+ ) {
27
30
Error . captureStackTrace ( this , ctr ) ;
28
31
} else {
29
32
this . message = 'Internal error' ;
Original file line number Diff line number Diff line change @@ -65,6 +65,13 @@ class Request {
65
65
* @throws {CoreError } Returns error or max authenticated request limit reached
66
66
*/
67
67
async send ( method , path , opts ) {
68
+ let trace = { } ;
69
+ Error . captureStackTrace ( trace , this . send ) ;
70
+ trace . stack = trace . stack
71
+ . split ( '\n' )
72
+ . splice ( 1 )
73
+ . join ( '\n' ) ;
74
+
68
75
opts = Object . assign (
69
76
{
70
77
headers : { } ,
@@ -143,6 +150,8 @@ class Request {
143
150
144
151
return body ;
145
152
} catch ( error ) {
153
+ error . stack = [ error . stack , trace . stack ] . join ( '\n' ) ;
154
+
146
155
if (
147
156
this . isCacheEnabled &&
148
157
opts . cache &&
@@ -208,7 +217,7 @@ class Request {
208
217
? error . response . text
209
218
: error instanceof CoreError && ( error . isInternal || error . isCache )
210
219
? error . typeof . name
211
- : error . stack ;
220
+ : ` ${ error . name } : ${ error . message } ` ;
212
221
213
222
if ( ! opts . mute ) {
214
223
this . log (
You can’t perform that action at this time.
0 commit comments