Jelajahi Sumber

don't force message over exception but include it as description

Brian Gough 10 tahun lalu
induk
melakukan
24e097d263
1 mengubah file dengan 3 tambahan dan 4 penghapusan
  1. 3 4
      libraries/logger/logging-manager.coffee

+ 3 - 4
libraries/logger/logging-manager.coffee

@@ -14,15 +14,14 @@ module.exports = Logger =
 	captureException: (attributes, message, level) ->
 	captureException: (attributes, message, level) ->
 		# handle case of logger.error "message"
 		# handle case of logger.error "message"
 		if typeof attributes is 'string'
 		if typeof attributes is 'string'
-			attributes = {err: attributes}
+			attributes = {err: new Error(attributes)}
 		# extract any error object
 		# extract any error object
 		error = attributes.err or attributes.error
 		error = attributes.err or attributes.error
-		# use our log message as the title when available
+		# include our log message in the error report
 		if not error?
 		if not error?
 			error = {message: message} if typeof message is 'string'
 			error = {message: message} if typeof message is 'string'
 		else if message?
 		else if message?
-			error.exception = error.message
-			error.message = message
+			attributes.description = message
 		# report the error
 		# report the error
 		if error?
 		if error?
 			# capture attributes and use *_id objects as tags
 			# capture attributes and use *_id objects as tags