summaryrefslogtreecommitdiffstats
path: root/src/ErrorHandlerInterface.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/ErrorHandlerInterface.php')
-rw-r--r--src/ErrorHandlerInterface.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/ErrorHandlerInterface.php b/src/ErrorHandlerInterface.php
new file mode 100644
index 0000000..0a26e14
--- /dev/null
+++ b/src/ErrorHandlerInterface.php
@@ -0,0 +1,31 @@
+<?php
+
+namespace Jasny;
+
+/**
+ * Interface for interacting with an error handler.
+ * The interface is not concerned with how the error handler is configured.
+ */
+interface ErrorHandlerInterface
+{
+ /**
+ * Set the caught error.
+ *
+ * @param \Throwable|\Exception|\Error
+ */
+ public function setError($error);
+
+ /**
+ * Get the caught error.
+ *
+ * @return \Throwable|\Exception|\Error
+ */
+ public function getError();
+
+ /**
+ * Log an error or exception
+ *
+ * @param \Exception|\Error $error
+ */
+ public function log($error);
+}