mirror of
https://gitlab.com/omair-personal/izyim.git
synced 2026-08-19 04:14:05 +00:00
update contact recode and clean up
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Contacts\Exceptions;
|
||||
use App\Classes\Exceptions\Common\ErrorException;
|
||||
use App\Classes\ValueObjects\Constants\HttpStatus;
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: user
|
||||
* Date: 07/03/2019
|
||||
* Time: 3:25 PM
|
||||
*/
|
||||
final class CannotCreateContactException
|
||||
final class CannotCreateContactException extends ErrorException
|
||||
{
|
||||
/** @param string $message */
|
||||
|
||||
@@ -16,6 +19,6 @@ final class CannotCreateContactException
|
||||
*/
|
||||
public function __construct(string $message)
|
||||
{
|
||||
|
||||
parent::_construct($message,HttpStatus::BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ namespace App\Modules\ControllerLogic\Contacts;
|
||||
|
||||
use App\Classes\Constants;
|
||||
use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
|
||||
use App\Classes\Modules\Contacts\Exceptions\CannotCreateContactException;
|
||||
use App\Classes\Modules\Contacts\Services\CreatesContact;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -30,8 +31,8 @@ class CreateContactLogic
|
||||
return $this->createContact->execute($object, $type, $referenceId);
|
||||
|
||||
}
|
||||
catch (){
|
||||
|
||||
catch (CannotCreateContactException $exception){
|
||||
throw new InternalServerErrorException("Failed to create contact because {$exception->getMessage()}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user