Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3994339
D171.id407.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D171.id407.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 11, 18:18 (20 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2345316
Default Alt Text
D171.id407.diff (2 KB)
Attached To
Mode
D171: Inject dependency into Action::attachError
Attached
Detach File
Event Timeline
Log In to Comment