File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
contexts/ArticlePublishing/Infrastructure/Records Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 44
55namespace Contexts \ArticlePublishing \Infrastructure \Records ;
66
7+ use App \Exceptions \SysException ;
78use App \Http \Models \BaseModel ;
89use Contexts \ArticlePublishing \Domain \Models \Article ;
910use Contexts \ArticlePublishing \Domain \Models \ArticleId ;
@@ -35,7 +36,7 @@ class ArticleRecord extends BaseModel
3536 public static function mapStatusToDomain (int $ status ): ArticleStatus
3637 {
3738 if (! isset (self ::STATUS_MAPPING [$ status ])) {
38- throw new \ InvalidArgumentException ('Invalid status value ' );
39+ throw SysException:: make ('Invalid status value: ' . $ status );
3940 }
4041
4142 return new ArticleStatus (self ::STATUS_MAPPING [$ status ]);
@@ -44,7 +45,7 @@ public static function mapStatusToDomain(int $status): ArticleStatus
4445 public static function mapStatusToRecord (ArticleStatus $ status ): int
4546 {
4647 if (! in_array ($ status ->getValue (), self ::STATUS_MAPPING )) {
47- throw new \ InvalidArgumentException ('Invalid status value ' );
48+ throw SysException:: make ('Invalid status value: ' . $ status -> getValue () );
4849 }
4950
5051 return array_search ($ status ->getValue (), self ::STATUS_MAPPING );
You can’t perform that action at this time.
0 commit comments