miaoda-react-devkit 0.1.1-beta.6 → 0.1.1-beta.7
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 +2 -48
- package/dist/index.js +2 -48
- package/dist/stubs/sentry-react-stub.js +2 -48
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -461,54 +461,8 @@ var PostMessageSubscriber = class {
|
|
|
461
461
|
};
|
|
462
462
|
this.send(msg, "*");
|
|
463
463
|
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
if (!isError && !isClientError) return;
|
|
467
|
-
const urlPath = extractUrlPath(url);
|
|
468
|
-
if (isError) {
|
|
469
|
-
const causeDesc = cause != null ? String(cause) : "NetworkError";
|
|
470
|
-
const errorMessage = `${method} ${urlPath} failed: ${causeDesc}`;
|
|
471
|
-
const msg = {
|
|
472
|
-
type: "GLOBAL_ERROR",
|
|
473
|
-
message: errorMessage,
|
|
474
|
-
error: cause != null ? { name: cause.name, message: cause.message, stack: cause.stack } : null,
|
|
475
|
-
errorData: {
|
|
476
|
-
name: cause?.name ?? "NetworkError",
|
|
477
|
-
message: cause?.message ?? causeDesc,
|
|
478
|
-
stack: cause?.stack ?? null,
|
|
479
|
-
fileName: url,
|
|
480
|
-
lineNumber: 0,
|
|
481
|
-
columnNumber: 0,
|
|
482
|
-
httpPath: urlPath,
|
|
483
|
-
httpStatus: 0,
|
|
484
|
-
httpMethod: method,
|
|
485
|
-
requestBody: requestBody ?? "",
|
|
486
|
-
responseBody: ""
|
|
487
|
-
}
|
|
488
|
-
};
|
|
489
|
-
this.send(msg, "*");
|
|
490
|
-
} else {
|
|
491
|
-
const errorMessage = `${method} ${urlPath} -> ${statusCode}`;
|
|
492
|
-
const msg = {
|
|
493
|
-
type: "GLOBAL_ERROR",
|
|
494
|
-
message: errorMessage,
|
|
495
|
-
error: null,
|
|
496
|
-
errorData: {
|
|
497
|
-
name: "HTTPClientError",
|
|
498
|
-
message: errorMessage,
|
|
499
|
-
stack: null,
|
|
500
|
-
fileName: url,
|
|
501
|
-
lineNumber: 0,
|
|
502
|
-
columnNumber: 0,
|
|
503
|
-
httpPath: urlPath,
|
|
504
|
-
httpStatus: statusCode,
|
|
505
|
-
httpMethod: method,
|
|
506
|
-
requestBody: requestBody ?? "",
|
|
507
|
-
responseBody: responseBody ?? ""
|
|
508
|
-
}
|
|
509
|
-
};
|
|
510
|
-
this.send(msg, "*");
|
|
511
|
-
}
|
|
464
|
+
// postMessage 场景不需要上报 network 日志
|
|
465
|
+
onNetworkRequest(_info) {
|
|
512
466
|
}
|
|
513
467
|
onPgRestWhitelistError({ type, method, url, statusCode, pgRestError, requestBody, responseBody }) {
|
|
514
468
|
const urlPath = extractUrlPath(url);
|
package/dist/index.js
CHANGED
|
@@ -429,54 +429,8 @@ var PostMessageSubscriber = class {
|
|
|
429
429
|
};
|
|
430
430
|
this.send(msg, "*");
|
|
431
431
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
if (!isError && !isClientError) return;
|
|
435
|
-
const urlPath = extractUrlPath(url);
|
|
436
|
-
if (isError) {
|
|
437
|
-
const causeDesc = cause != null ? String(cause) : "NetworkError";
|
|
438
|
-
const errorMessage = `${method} ${urlPath} failed: ${causeDesc}`;
|
|
439
|
-
const msg = {
|
|
440
|
-
type: "GLOBAL_ERROR",
|
|
441
|
-
message: errorMessage,
|
|
442
|
-
error: cause != null ? { name: cause.name, message: cause.message, stack: cause.stack } : null,
|
|
443
|
-
errorData: {
|
|
444
|
-
name: cause?.name ?? "NetworkError",
|
|
445
|
-
message: cause?.message ?? causeDesc,
|
|
446
|
-
stack: cause?.stack ?? null,
|
|
447
|
-
fileName: url,
|
|
448
|
-
lineNumber: 0,
|
|
449
|
-
columnNumber: 0,
|
|
450
|
-
httpPath: urlPath,
|
|
451
|
-
httpStatus: 0,
|
|
452
|
-
httpMethod: method,
|
|
453
|
-
requestBody: requestBody ?? "",
|
|
454
|
-
responseBody: ""
|
|
455
|
-
}
|
|
456
|
-
};
|
|
457
|
-
this.send(msg, "*");
|
|
458
|
-
} else {
|
|
459
|
-
const errorMessage = `${method} ${urlPath} -> ${statusCode}`;
|
|
460
|
-
const msg = {
|
|
461
|
-
type: "GLOBAL_ERROR",
|
|
462
|
-
message: errorMessage,
|
|
463
|
-
error: null,
|
|
464
|
-
errorData: {
|
|
465
|
-
name: "HTTPClientError",
|
|
466
|
-
message: errorMessage,
|
|
467
|
-
stack: null,
|
|
468
|
-
fileName: url,
|
|
469
|
-
lineNumber: 0,
|
|
470
|
-
columnNumber: 0,
|
|
471
|
-
httpPath: urlPath,
|
|
472
|
-
httpStatus: statusCode,
|
|
473
|
-
httpMethod: method,
|
|
474
|
-
requestBody: requestBody ?? "",
|
|
475
|
-
responseBody: responseBody ?? ""
|
|
476
|
-
}
|
|
477
|
-
};
|
|
478
|
-
this.send(msg, "*");
|
|
479
|
-
}
|
|
432
|
+
// postMessage 场景不需要上报 network 日志
|
|
433
|
+
onNetworkRequest(_info) {
|
|
480
434
|
}
|
|
481
435
|
onPgRestWhitelistError({ type, method, url, statusCode, pgRestError, requestBody, responseBody }) {
|
|
482
436
|
const urlPath = extractUrlPath(url);
|
|
@@ -432,54 +432,8 @@ var PostMessageSubscriber = class {
|
|
|
432
432
|
};
|
|
433
433
|
this.send(msg, "*");
|
|
434
434
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
if (!isError && !isClientError) return;
|
|
438
|
-
const urlPath = extractUrlPath(url);
|
|
439
|
-
if (isError) {
|
|
440
|
-
const causeDesc = cause != null ? String(cause) : "NetworkError";
|
|
441
|
-
const errorMessage = `${method} ${urlPath} failed: ${causeDesc}`;
|
|
442
|
-
const msg = {
|
|
443
|
-
type: "GLOBAL_ERROR",
|
|
444
|
-
message: errorMessage,
|
|
445
|
-
error: cause != null ? { name: cause.name, message: cause.message, stack: cause.stack } : null,
|
|
446
|
-
errorData: {
|
|
447
|
-
name: cause?.name ?? "NetworkError",
|
|
448
|
-
message: cause?.message ?? causeDesc,
|
|
449
|
-
stack: cause?.stack ?? null,
|
|
450
|
-
fileName: url,
|
|
451
|
-
lineNumber: 0,
|
|
452
|
-
columnNumber: 0,
|
|
453
|
-
httpPath: urlPath,
|
|
454
|
-
httpStatus: 0,
|
|
455
|
-
httpMethod: method,
|
|
456
|
-
requestBody: requestBody ?? "",
|
|
457
|
-
responseBody: ""
|
|
458
|
-
}
|
|
459
|
-
};
|
|
460
|
-
this.send(msg, "*");
|
|
461
|
-
} else {
|
|
462
|
-
const errorMessage = `${method} ${urlPath} -> ${statusCode}`;
|
|
463
|
-
const msg = {
|
|
464
|
-
type: "GLOBAL_ERROR",
|
|
465
|
-
message: errorMessage,
|
|
466
|
-
error: null,
|
|
467
|
-
errorData: {
|
|
468
|
-
name: "HTTPClientError",
|
|
469
|
-
message: errorMessage,
|
|
470
|
-
stack: null,
|
|
471
|
-
fileName: url,
|
|
472
|
-
lineNumber: 0,
|
|
473
|
-
columnNumber: 0,
|
|
474
|
-
httpPath: urlPath,
|
|
475
|
-
httpStatus: statusCode,
|
|
476
|
-
httpMethod: method,
|
|
477
|
-
requestBody: requestBody ?? "",
|
|
478
|
-
responseBody: responseBody ?? ""
|
|
479
|
-
}
|
|
480
|
-
};
|
|
481
|
-
this.send(msg, "*");
|
|
482
|
-
}
|
|
435
|
+
// postMessage 场景不需要上报 network 日志
|
|
436
|
+
onNetworkRequest(_info) {
|
|
483
437
|
}
|
|
484
438
|
onPgRestWhitelistError({ type, method, url, statusCode, pgRestError, requestBody, responseBody }) {
|
|
485
439
|
const urlPath = extractUrlPath(url);
|