Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14765057
D10211.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D10211.id.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -130,6 +130,7 @@
'ConduitException' => 'applications/conduit/protocol/exception/ConduitException.php',
'ConduitGetCertificateConduitAPIMethod' => 'applications/conduit/method/ConduitGetCertificateConduitAPIMethod.php',
'ConduitLogGarbageCollector' => 'applications/conduit/garbagecollector/ConduitLogGarbageCollector.php',
+ 'ConduitMethodDoesNotExistException' => 'applications/conduit/protocol/exception/ConduitMethodDoesNotExistException.php',
'ConduitMethodNotFoundException' => 'applications/conduit/protocol/exception/ConduitMethodNotFoundException.php',
'ConduitPingConduitAPIMethod' => 'applications/conduit/method/ConduitPingConduitAPIMethod.php',
'ConduitQueryConduitAPIMethod' => 'applications/conduit/method/ConduitQueryConduitAPIMethod.php',
@@ -2872,6 +2873,7 @@
'ConduitException' => 'Exception',
'ConduitGetCertificateConduitAPIMethod' => 'ConduitAPIMethod',
'ConduitLogGarbageCollector' => 'PhabricatorGarbageCollector',
+ 'ConduitMethodDoesNotExistException' => 'ConduitMethodNotFoundException',
'ConduitMethodNotFoundException' => 'ConduitException',
'ConduitPingConduitAPIMethod' => 'ConduitAPIMethod',
'ConduitQueryConduitAPIMethod' => 'ConduitAPIMethod',
diff --git a/src/applications/conduit/call/ConduitCall.php b/src/applications/conduit/call/ConduitCall.php
--- a/src/applications/conduit/call/ConduitCall.php
+++ b/src/applications/conduit/call/ConduitCall.php
@@ -172,7 +172,7 @@
$method = ConduitAPIMethod::getConduitMethod($method_name);
if (!$method) {
- throw new ConduitMethodNotFoundException($method_name);
+ throw new ConduitMethodDoesNotExistException($method_name);
}
$application = $method->getApplication();
diff --git a/src/applications/conduit/protocol/exception/ConduitApplicationNotInstalledException.php b/src/applications/conduit/protocol/exception/ConduitApplicationNotInstalledException.php
--- a/src/applications/conduit/protocol/exception/ConduitApplicationNotInstalledException.php
+++ b/src/applications/conduit/protocol/exception/ConduitApplicationNotInstalledException.php
@@ -3,11 +3,11 @@
final class ConduitApplicationNotInstalledException
extends ConduitMethodNotFoundException {
- public function __construct($method, $application) {
+ public function __construct(ConduitAPIMethod $method, $application) {
parent::__construct(
pht(
"Method '%s' belongs to application '%s', which is not installed.",
- $method,
+ $method->getAPIMethodName(),
$application));
}
diff --git a/src/applications/conduit/protocol/exception/ConduitMethodDoesNotExistException.php b/src/applications/conduit/protocol/exception/ConduitMethodDoesNotExistException.php
new file mode 100644
--- /dev/null
+++ b/src/applications/conduit/protocol/exception/ConduitMethodDoesNotExistException.php
@@ -0,0 +1,12 @@
+<?php
+
+final class ConduitMethodDoesNotExistException
+ extends ConduitMethodNotFoundException {
+
+ public function __construct($method_name) {
+ parent::__construct(
+ pht(
+ 'Conduit API method "%s" does not exist.'));
+ }
+
+}
diff --git a/src/applications/conduit/protocol/exception/ConduitMethodNotFoundException.php b/src/applications/conduit/protocol/exception/ConduitMethodNotFoundException.php
--- a/src/applications/conduit/protocol/exception/ConduitMethodNotFoundException.php
+++ b/src/applications/conduit/protocol/exception/ConduitMethodNotFoundException.php
@@ -1,12 +1,5 @@
<?php
-/**
- * @concrete-extensible
- */
-class ConduitMethodNotFoundException extends ConduitException {
-
- public function __construct($method) {
- parent::__construct(pht("Conduit method '%s' does not exist.", $method));
- }
+abstract class ConduitMethodNotFoundException extends ConduitException {
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 24, 3:16 PM (20 h, 23 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7041121
Default Alt Text
D10211.id.diff (3 KB)
Attached To
Mode
D10211: Fix string construction in Conduit exceptions
Attached
Detach File
Event Timeline
Log In to Comment