Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement InstallationFailed exception
- Loading branch information
1 parent
b1a07ed
commit 55c8c13
Showing
2 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
application/MantisBT/Exception/Plugin/InstallationFailed.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
namespace MantisBT\Exception\Plugin; | ||
use MantisBT\Exception\ExceptionAbstract; | ||
|
||
require_api('lang_api.php'); | ||
|
||
/* TODO: This class is currently too vague. Plugins should throw more detailed | ||
* exceptions. Perhaps this class can be abstracted so that it can be extended | ||
* by plugins, but handled by MantisBT core in consistent ways. | ||
*/ | ||
class InstallationFailed extends ExceptionAbstract { | ||
public function __construct($pluginName, $failureReason) { | ||
$errorMessage = lang_get(ERROR_PLUGIN_INSTALL_FAILED, null, false); | ||
$errorMessage = sprintf($errorMessage, $pluginName, $failureReason); | ||
parent::__construct(ERROR_PLUGIN_INSTALL_FAILED, $errorMessage, null); | ||
$this->responseCode = 500; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters