diff --git a/src/Exception/LeanApiException.php b/src/Exception/LeanApiException.php new file mode 100644 index 0000000..b405bdd --- /dev/null +++ b/src/Exception/LeanApiException.php @@ -0,0 +1,5 @@ +object->assertValueSpecs($context->$name ?? null, ! $this->getEntity()->isLoaded()); - } - catch(\Throwable $ex) { - throw new MandatoryFieldException("An error occured with field '$name': " . $ex->getMessage()); + } catch (LeanApiException $e) { + throw new MandatoryFieldException("An error occured with field '$name': " . $e->getMessage()); } } }