Skip to content

Commit

Permalink
Improve Exception message to provide the name of the invalid property…
Browse files Browse the repository at this point in the history
… type exactly how it's done already for Pages PropertyFactory
  • Loading branch information
florianfirmenich committed Jan 9, 2023
1 parent fdf5b6d commit a798191
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Databases/Properties/PropertyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static function fromArray(array $array): PropertyInterface
PropertyType::Status => Status::fromArray($array),
PropertyType::Title => Title::fromArray($array),
PropertyType::Url => Url::fromArray($array),
default => throw new Exception("Invalid property type."),
default => throw new Exception("Invalid property type: '{$array['type']}'"),
};
}
}

0 comments on commit a798191

Please sign in to comment.