Skip to content

Commit

Permalink
fix: incorrect exception on invalid query
Browse files Browse the repository at this point in the history
  • Loading branch information
kauffinger committed Nov 11, 2024
1 parent 41d3a8e commit bc9cefa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## main
- TODO: Remove old activity repository code in next major release

## v1.5.8
- fix incorrect exception type on invalid create query

## v1.5.7
- enable create call in searchcriteria repository
Expand Down
3 changes: 2 additions & 1 deletion src/Query/SearchCriteriaBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Innobrain\OnOfficeAdapter\Enums\OnOfficeAction;
use Innobrain\OnOfficeAdapter\Enums\OnOfficeResourceType;
use Innobrain\OnOfficeAdapter\Exceptions\OnOfficeException;
use Innobrain\OnOfficeAdapter\Exceptions\OnOfficeQueryException;
use Innobrain\OnOfficeAdapter\Services\OnOfficeService;
use Throwable;

Expand Down Expand Up @@ -43,7 +44,7 @@ public function find(int|array $id): ?array
public function create(array $data): array
{
if (! isset($this->addressId)) {
throw new OnOfficeException('Address ID is required to create a search criteria');
throw new OnOfficeQueryException('Address ID is required to create a search criteria');
}

$request = new OnOfficeRequest(
Expand Down

0 comments on commit bc9cefa

Please sign in to comment.