瀏覽代碼

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

Brian Gough 10 年之前
父節點
當前提交
24e097d263
共有 1 個文件被更改,包括 3 次插入 和 4 次删除
  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) ->
 		# handle case of logger.error "message"
 		if typeof attributes is 'string'
-			attributes = {err: attributes}
+			attributes = {err: new Error(attributes)}
 		# extract any error object
 		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?
 			error = {message: message} if typeof message is 'string'
 		else if message?
-			error.exception = error.message
-			error.message = message
+			attributes.description = message
 		# report the error
 		if error?
 			# capture attributes and use *_id objects as tags