Page MenuHomeDevCentral

D171.diff
No OneTemporary

D171.diff

diff --git a/app/Actions/Action.php b/app/Actions/Action.php
--- a/app/Actions/Action.php
+++ b/app/Actions/Action.php
@@ -21,11 +21,16 @@
}
/**
- * Attaches an exception to an action to report
+ * Attaches an error to the action to report
*
- * @param \Exception $ex The exception to attach to the error report
+ * To attach an exception, you can use:
+ * <code>
+ * $actionToReport->attachError(new ActionError($exception));
+ * </code>
+ *
+ * @param Nasqueron\Notifications\Actions\ActionError $error The error to attach
*/
- public function attachException ($ex) {
- $this->error = new ActionError($ex);
+ public function attachError (ActionError $error) {
+ $this->error = $error;
}
}
diff --git a/app/Jobs/SendMessageToBroker.php b/app/Jobs/SendMessageToBroker.php
--- a/app/Jobs/SendMessageToBroker.php
+++ b/app/Jobs/SendMessageToBroker.php
@@ -3,6 +3,7 @@
namespace Nasqueron\Notifications\Jobs;
use Illuminate\Contracts\Bus\SelfHandling;
+use Nasqueron\Notifications\Actions\ActionError;
use Nasqueron\Notifications\Actions\AMQPAction;
use Nasqueron\Notifications\Events\ReportEvent;
use Nasqueron\Notifications\Jobs\Job;
@@ -99,7 +100,7 @@
$this->routingKey
);
if ($this->exception !== null) {
- $actionToReport->attachException($this->exception);
+ $actionToReport->attachError(new ActionError($this->exception));
}
Event::fire(new ReportEvent($actionToReport));
}
diff --git a/app/Listeners/PhabricatorListener.php b/app/Listeners/PhabricatorListener.php
--- a/app/Listeners/PhabricatorListener.php
+++ b/app/Listeners/PhabricatorListener.php
@@ -2,6 +2,7 @@
namespace Nasqueron\Notifications\Listeners;
+use Nasqueron\Notifications\Actions\ActionError;
use Nasqueron\Notifications\Actions\NotifyNewCommitsAction;
use Nasqueron\Notifications\Events\GitHubPayloadEvent;
use Nasqueron\Notifications\Events\ReportEvent;
@@ -68,7 +69,7 @@
[ 'callsigns[0]' => $callSign ]
);
} catch (PhabricatorAPIException $ex) {
- $actionToReport->attachException($ex);
+ $actionToReport->attachError(new ActionError($ex));
}
Event::fire(new ReportEvent($actionToReport));

File Metadata

Mime Type
text/plain
Expires
Sat, Jan 11, 15:42 (19 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2345316
Default Alt Text
D171.diff (2 KB)

Event Timeline