22
33const { inspect } = require ( 'util' )
44
5- const { printMultiline , print , prettify } = require ( './serialize' )
5+ const { serialize , prettify } = require ( './serialize' )
66
77// Retrieve `message` which sums up all information that can be gathered about
88// the event.
@@ -37,24 +37,22 @@ const defaultGetMessage = function({
3737}
3838
3939const uncaughtException = function ( { error } ) {
40- return `An exception was thrown but not caught
41- ${ print ( error ) } `
40+ return `This exception was thrown but not caught: ${ serialize ( error ) } `
4241}
4342
4443const warning = function ( { error, error : { code, detail = '' } } ) {
4544 const codeMessage = code === undefined ? '' : `(${ code } ) `
46- return `${ codeMessage } ${ detail }
47- ${ print ( error ) } `
45+ return `${ codeMessage } ${ detail } ${ serialize ( error ) } `
4846}
4947
5048const unhandledRejection = function ( { promiseValue } ) {
51- return `A promise was rejected but not handled
52- Promise was rejected with: ${ printMultiline ( promiseValue ) } `
49+ return `This promise was rejected but not handled: ${ serialize ( promiseValue ) } `
5350}
5451
5552const rejectionHandled = function ( { promiseValue } ) {
56- return `A promise was rejected and handled too late
57- Promise was rejected with: ${ printMultiline ( promiseValue ) } `
53+ return `This promise was rejected and handled too late: ${ serialize (
54+ promiseValue ,
55+ ) } `
5856}
5957
6058const multipleResolves = function ( {
@@ -64,9 +62,10 @@ const multipleResolves = function({
6462 secondPromiseValue,
6563} ) {
6664 const again = promiseState === secondPromiseState ? ' again' : ''
67- return `A promise was resolved/rejected multiple times
68- Promise was initially ${ promiseState } with: ${ printMultiline ( promiseValue ) }
69- Promise was then ${ secondPromiseState } ${ again } with: ${ printMultiline (
65+ return `A promise was resolved/rejected multiple times. It was initially ${ promiseState } with: ${ serialize (
66+ promiseValue ,
67+ ) }
68+ It was then ${ secondPromiseState } ${ again } with: ${ serialize (
7069 secondPromiseValue ,
7170 ) } `
7271}
0 commit comments