/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2021 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
this(statusCode, message, exception, null);
}
+ /**
+ * Instantiates a new model runtime exception from a PfModelException instance.
+ *
+ * @param exception the exception that caused this model exception
+ */
+ public PfModelRuntimeException(final PfModelException exception) {
+ super(exception.getMessage(), exception);
+ this.object = exception.getObject();
+ errorResponse.setResponseCode(exception.getErrorResponse().getResponseCode());
+ ErrorResponseUtils.getExceptionMessages(errorResponse, this);
+ }
+
/**
* Instantiates a new model runtime exception.
*