OPENDJ-1762 (CR-5923) verify-index on non existing index fails with NullPointerException when the server is stopped
Verifying a non existing index triggers some untested unhappy paths.
Faulty exception handling was creating the issue.
PersistItStorage.java:
In read(), only throw the cause if there is a cause.
VerifyJob.java:
Do not wrap StorageRuntimeException inside StorageRuntimeException.
BackendImpl.java:
Chain the original exception.
| | |
| | | } |
| | | catch (final StorageRuntimeException e) |
| | | { |
| | | throw (Exception) e.getCause(); |
| | | if (e.getCause() != null) |
| | | { |
| | | throw (Exception) e.getCause(); |
| | | } |
| | | throw e; |
| | | } |
| | | finally |
| | | { |
| | |
| | | } |
| | | catch (final StorageRuntimeException e) |
| | | { |
| | | throw (Exception) e.getCause(); |
| | | if (e.getCause() != null) |
| | | { |
| | | throw (Exception) e.getCause(); |
| | | } |
| | | throw e; |
| | | } |
| | | finally |
| | | { |
| | |
| | | { |
| | | return new DirectoryException( |
| | | DirectoryServer.getServerErrorResultCode(), |
| | | LocalizableMessage.raw(e.getMessage())); |
| | | LocalizableMessage.raw(e.getMessage()), e); |
| | | } |
| | | } |
| | | if (/*e instanceof EnvironmentFailureException && */ !rootContainer.isValid()) { |
| | |
| | | } |
| | | }); |
| | | } |
| | | catch (StorageRuntimeException e) |
| | | { |
| | | throw e; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw new StorageRuntimeException(e); |