Skip to content

Commit

Permalink
fix: change on office exception when file is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Katalam committed Oct 7, 2024
1 parent 0e6562d commit 1771811
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Query/EstateFileBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Support\Collection;
use Innobrain\OnOfficeAdapter\Dtos\OnOfficeRequest;
use Innobrain\OnOfficeAdapter\Enums\OnOfficeAction;
use Innobrain\OnOfficeAdapter\Enums\OnOfficeError;
use Innobrain\OnOfficeAdapter\Enums\OnOfficeResourceId;
use Innobrain\OnOfficeAdapter\Enums\OnOfficeResourceType;
use Innobrain\OnOfficeAdapter\Exceptions\OnOfficeException;
Expand Down Expand Up @@ -82,7 +83,11 @@ public function find(int $id): array
$result = $response->json('response.results.0.data.records.0');

if (! $result) {
throw new OnOfficeException('File not found');
throw new OnOfficeException(
OnOfficeError::File_Not_Found->toString(),
OnOfficeError::File_Not_Found->value,
isResponseError: true,
);
}

return $result;
Expand Down

0 comments on commit 1771811

Please sign in to comment.