use of org.mule.runtime.api.meta.model.error.ErrorModel in project mule by mulesoft.
the class ErrorsModelFactory method addConnectivityErrors.
private void addConnectivityErrors(Map<String, ErrorModel> errorModelMap) {
ErrorModel connectivityError = toErrorModel(CONNECTIVITY, errorModelMap);
String key = connectivityError.toString();
if (!errorModelMap.containsKey(key)) {
errorModelMap.put(key, connectivityError);
}
ErrorModel retryExhaustedError = toErrorModel(RETRY_EXHAUSTED, errorModelMap);
String retry = retryExhaustedError.toString();
if (!errorModelMap.containsKey(retry)) {
errorModelMap.put(retry, retryExhaustedError);
}
}
use of org.mule.runtime.api.meta.model.error.ErrorModel in project mule by mulesoft.
the class ErrorsDeclarationEnricherTestCase method operationInheritsExtensionErrorThrows.
@Test
public void operationInheritsExtensionErrorThrows() {
extensionModel = loadExtension(HeisenbergWithExtensionThrows.class);
OperationModel someOperation = extensionModel.getOperationModel("someOperation").get();
Optional<ErrorModel> operationError = someOperation.getErrorModels().stream().filter(errorModel -> errorModel.getType().equals(EXTENSION.getType())).findFirst();
assertThat(operationError.isPresent(), is(true));
}
Aggregations