use of tech.pegasys.teku.storage.server.DatabaseStorageException in project teku by ConsenSys.
the class BeaconNodeCommand method call.
@Override
public Integer call() {
try {
startLogging();
final TekuConfiguration tekuConfig = tekuConfiguration();
startAction.start(tekuConfig, false);
return 0;
} catch (InvalidConfigurationException | DatabaseStorageException ex) {
reportUserError(ex);
} catch (CompletionException e) {
ExceptionUtil.<Throwable>getCause(e, InvalidConfigurationException.class).or(() -> ExceptionUtil.getCause(e, DatabaseStorageException.class)).ifPresentOrElse(this::reportUserError, () -> reportUnexpectedError(e));
} catch (Throwable t) {
reportUnexpectedError(t);
}
return 1;
}
use of tech.pegasys.teku.storage.server.DatabaseStorageException in project teku by ConsenSys.
the class RocksDbExceptionUtilTest method shouldIdentifyRecoverableExceptions.
@ParameterizedTest
@MethodSource("recoverableErrorCodes")
void shouldIdentifyRecoverableExceptions(final Code code) {
final RocksDBException exception = new RocksDBException(new Status(code, SubCode.None, null));
final DatabaseStorageException result = RocksDbExceptionUtil.wrapException("Test", exception);
assertThat(result).hasMessage("Test");
assertThat(result.isUnrecoverable()).isFalse();
}
use of tech.pegasys.teku.storage.server.DatabaseStorageException in project teku by ConsenSys.
the class ValidatorClientCommand method call.
@Override
public Integer call() {
try {
startLogging();
final TekuConfiguration globalConfiguration = tekuConfiguration();
parentCommand.getStartAction().start(globalConfiguration, true);
return 0;
} catch (InvalidConfigurationException | DatabaseStorageException ex) {
parentCommand.reportUserError(ex);
} catch (CompletionException e) {
ExceptionUtil.<Throwable>getCause(e, InvalidConfigurationException.class).or(() -> ExceptionUtil.getCause(e, DatabaseStorageException.class)).ifPresentOrElse(parentCommand::reportUserError, () -> parentCommand.reportUnexpectedError(e));
} catch (Throwable t) {
parentCommand.reportUnexpectedError(t);
}
return 1;
}
use of tech.pegasys.teku.storage.server.DatabaseStorageException in project teku by ConsenSys.
the class RocksDbExceptionUtilTest method shouldBeUnrecoverableWhenCodeIsNotRecoverable.
@Test
void shouldBeUnrecoverableWhenCodeIsNotRecoverable() {
final RocksDBException exception = new RocksDBException(new Status(Code.IOError, SubCode.None, null));
final DatabaseStorageException result = RocksDbExceptionUtil.wrapException("Test", exception);
assertThat(result.isUnrecoverable()).isTrue();
}
use of tech.pegasys.teku.storage.server.DatabaseStorageException in project teku by ConsenSys.
the class RocksDbExceptionUtilTest method shouldBeUnrecoverableWhenNoStatusIsSet.
@Test
void shouldBeUnrecoverableWhenNoStatusIsSet() {
final RocksDBException exception = new RocksDBException("Oh dear");
final DatabaseStorageException result = RocksDbExceptionUtil.wrapException("Test", exception);
assertThat(result.isUnrecoverable()).isTrue();
}
Aggregations