/** * Records result from a common exception type. This automatically * determines status and also sets appropriate message. * * @param exception * common exception */ public void record(CommonException exception) { // TODO: switch to a localized message later // Exception is a fatal error in this context recordFatalError(exception.getErrorTypeMessage(), exception); }
public <T extends ObjectType> T getObjectSimple(Class<T> clazz, String oid, GetOperationOptions options, Task task, OperationResult result) throws ObjectNotFoundException { try { return getObject(clazz, oid, SelectorOptions.createCollection(options), task, result); } catch (SystemException ex) { throw ex; } catch (ObjectNotFoundException ex) { throw ex; } catch (CommonException ex) { LoggingUtils.logException(LOGGER, "Error resolving object with oid {}", ex, oid); // Add to result only a short version of the error, the details will be in subresults result.recordFatalError( "Couldn't get object with oid '" + oid + "': "+ex.getErrorTypeMessage(), ex); throw new SystemException("Error resolving object with oid '" + oid + "': "+ex.getMessage(), ex); } }