Catch UnrecoverableError in another clause in the FASTEN server
@@ -294,12 +294,11 @@ public class FastenKafkaPlugin implements FastenServerPlugin {
plugin.consume(record.value());
}
}
- } catch (RuntimeException e) {
+ } catch (UnrecoverableError e) {
// In rare circumstances, plug-ins throw UnrecoverableError to crash and therefore K8s will restart the plug-in.
- if (e instanceof UnrecoverableError) {
logger.error("Forced to stop the plug-in due to ", e);
throw e;
- }
+ } catch (RuntimeException e) {
logger.error("An error occurred in " + plugin.getClass().getCanonicalName(), e);
plugin.setPluginError(e);
}
