This commit is contained in:
21
AppStore/libs/exceptions.php
Normal file
21
AppStore/libs/exceptions.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
class JsonableException extends Exception {
|
||||
|
||||
public function responseJson()
|
||||
{
|
||||
header('Content-Type: application/json');
|
||||
|
||||
echo json_encode(array(
|
||||
'status' => false,
|
||||
'error' => $this->getMessage(),
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class VersionNotMatchException extends JsonableException{}
|
||||
|
||||
class DownloadErrorException extends JsonableException{}
|
||||
|
||||
class UnzipErrorException extends JsonableException{}
|
||||
Reference in New Issue
Block a user