Page MenuHomePhabricator

D10211.id.diff
No OneTemporary

D10211.id.diff

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

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)

Event Timeline