Closed mrleblanc101 closed 1 year ago
I think you might be able to do that already using the publishRelease.errorHandler
option. It's part of Sentry own types and is documented as:
/**
* When a CLI error occurs, the plugin will call this function.
*
* By default, it will call `invokeErr()`, thereby stopping Webpack
* compilation. To allow compilation to continue and log a warning instead,
* set this to
* (err, invokeErr, compilation) => {
* compilation.warnings.push('Sentry CLI Plugin: ' + err.message)
* }
*
* Note: `compilation` is typed as `unknown` in order to preserve
* compatibility with both Webpack 4 and Webpack 5 types, If you need the
* correct type, in Webpack 4 use `compilation.Compilation` and in Webpack 5
* use `Compilation`.
*/
errorHandler?: (
err: Error,
invokeErr: () => void,
compilation: unknown
) => void;
BTW. There is also this Nuxt issue that causes Sentry errors during publishing to be hidden: https://github.com/nuxt/nuxt/issues/21284 Not sure if you were also hit by this and had to guess what the issue is when it happened?
@rchl Thanks for the tip, will try !
The error seems to work for me:
Which is indeed caused by the fact that our self-hosted Sentry is down:
I was not able to make it work.
I tried both in my nuxt.config.js
:
sentry: {
config: {
errorHandler: (err, invokeErr, compilation) => {
compilation.warnings.push('Sentry CLI Plugin: ' + err.message);
},
},
},
And
sentry: {
errorHandler: (err, invokeErr, compilation) => {
compilation.warnings.push('Sentry CLI Plugin: ' + err.message);
},
},
sentry: {
publishRelease: {
errorHandler: ...
}
}
@rchl The only possibility I didn't try I guess 😅
Thanks, I searched in the Sentry documentation instead of the sentry-webpack-plugin
documentation.
Hi, Should build fail if
publishRelease
fail because Sentry instance is down ? I'm trying to deploy my app, and our self-hosted Sentry is currently down. I can't deploy because I havepublishRelease: true
which fails. Should we have an option to ignore this is complete the build ?