@localstack/appinspector-ui 1.0.216 → 1.0.218
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +19 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -13
- package/dist/index.js.map +1 -1
- package/dist/spans-worker.js +12 -1
- package/package.json +1 -1
package/dist/spans-worker.js
CHANGED
|
@@ -193,6 +193,17 @@
|
|
|
193
193
|
|
|
194
194
|
// src/utils/span-issues.ts
|
|
195
195
|
var firstText = (...values) => values.find((value) => !!value) ?? void 0;
|
|
196
|
+
var getExceptionCode = (span) => {
|
|
197
|
+
const raw = span.attributes?.["localstack.aws.service.exception"];
|
|
198
|
+
if (typeof raw !== "string") return void 0;
|
|
199
|
+
try {
|
|
200
|
+
const exception = JSON.parse(raw);
|
|
201
|
+
const code = exception.code ?? exception.Code;
|
|
202
|
+
return typeof code === "string" ? code : void 0;
|
|
203
|
+
} catch {
|
|
204
|
+
return void 0;
|
|
205
|
+
}
|
|
206
|
+
};
|
|
196
207
|
var OTEL_STATUS_ERROR = 2;
|
|
197
208
|
var getIamOutcome = (span) => {
|
|
198
209
|
const iamEvents = getIamEvents(span);
|
|
@@ -220,7 +231,7 @@
|
|
|
220
231
|
const denialCount = unenforcedDenial ? Math.max(1, denials.length) : 0;
|
|
221
232
|
return {
|
|
222
233
|
error,
|
|
223
|
-
errorType: error ? firstText(span.status_message, errorMessages[0]?.message) ?? (iamDenied ? "AccessDenied" : "Error") : void 0,
|
|
234
|
+
errorType: error ? firstText(span.status_message, errorMessages[0]?.message, getExceptionCode(span)) ?? (iamDenied ? "AccessDenied" : "Error") : void 0,
|
|
224
235
|
warning,
|
|
225
236
|
warningCount: warning ? Math.max(1, warningMessages.length + denialCount) : 0,
|
|
226
237
|
warningType: warning ? firstText(warningMessages[0]?.message) ?? (unenforcedDenial ? `IAM ${denials[0] ?? "implicit"} deny` : iamWarned ? "IAM permission warning" : "Warning") : void 0
|