Installing and managing modules from admin panel (#847)

This commit is contained in:
Yash Govekar
2020-10-19 19:40:28 +05:30
committed by GitHub
parent ca220f1cdf
commit 5803487d51
92 changed files with 1259 additions and 669 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace App\Exceptions;
class ModuleExistsException extends AbstractHttpException
{
private $module_name;
public function __construct($module_name)
{
$this->module_name = $module_name;
parent::__construct(
409,
'Module '.$module_name.' Already Exists!'
);
}
/**
* Return the RFC 7807 error type (without the URL root)
*/
public function getErrorType(): string
{
return 'module-already-exists';
}
/**
* Get the detailed error string
*/
public function getErrorDetails(): string
{
return $this->getMessage();
}
/**
* Return an array with the error details, merged with the RFC7807 response
*/
public function getErrorMetadata(): array
{
return [];
}
}