@sentry/utils
Advanced tools
Comparing version 4.0.0 to 4.0.1
/// <reference types="node" /> | ||
import { SentryEvent } from '@sentry/types'; | ||
/** | ||
@@ -40,1 +41,6 @@ * Safely get global scope object | ||
}; | ||
/** | ||
* Extracts either message or type+value from an event that can be used for user-facing logs | ||
* @returns event's description | ||
*/ | ||
export declare function getEventDescription(event: SentryEvent): string; |
22
misc.js
@@ -154,2 +154,24 @@ "use strict"; | ||
exports.parseUrl = parseUrl; | ||
/** | ||
* Extracts either message or type+value from an event that can be used for user-facing logs | ||
* @returns event's description | ||
*/ | ||
function getEventDescription(event) { | ||
if (event.message) { | ||
return event.message; | ||
} | ||
else if (event.exception && event.exception.values && event.exception.values[0]) { | ||
var exception = event.exception.values[0]; | ||
if (exception.type && exception.value) { | ||
return exception.type + ": " + exception.value; | ||
} | ||
else { | ||
return exception.type || exception.value || event.event_id || '<unknown>'; | ||
} | ||
} | ||
else { | ||
return event.event_id || '<unknown>'; | ||
} | ||
} | ||
exports.getEventDescription = getEventDescription; | ||
//# sourceMappingURL=misc.js.map |
{ | ||
"name": "@sentry/utils", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Utilities for all Sentry JavaScript SDKs", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com/getsentry/raven-js.git", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
104793
1484