mirror of
https://github.com/ZSCGR/CloudFlare-ImgBed.git
synced 2026-08-16 21:53:43 +08:00
20 lines
602 B
JavaScript
20 lines
602 B
JavaScript
/**
|
|
* Mock for @cloudflare/pages-plugin-sentry
|
|
* Docker 模式下不使用 Sentry,提供空实现
|
|
*/
|
|
export default function sentryPlugin(config) {
|
|
return function(context) {
|
|
// 提供一个空的 sentry 对象以兼容 telemetryData 中的调用
|
|
if (!context.data) context.data = {};
|
|
context.data.sentry = {
|
|
setTag: () => {},
|
|
setContext: () => {},
|
|
startTransaction: () => ({
|
|
startChild: () => ({ finish: () => {} }),
|
|
finish: () => {}
|
|
})
|
|
};
|
|
return context.next();
|
|
};
|
|
}
|