Skip to content

Commit

Permalink
Merge pull request #176 from AmpersandTarski/bugfix/115-concept-not-d…
Browse files Browse the repository at this point in the history
…efined-exception

Bugfix name ConceptNotDefinedException to match class filename
  • Loading branch information
Michiel-s authored Apr 26, 2024
2 parents 098e17f + fa11128 commit a336052
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Additional labels for pre-release and build metadata are available as extensions

## Unreleased changes
* [Issue 79](https://github.com/AmpersandTarski/prototype/issues/79) Add support for delimited multi value columns in excel importer
* [Issue 115](https://github.com/AmpersandTarski/prototype/issues/115) Bugfix name ConceptNotDefinedException to match class filename
* Catch FileNotFoundException and log warning when corresponding file of deleted FileObject is not found on filesystem
* Skip tracking affected relations and concepts for RELATION lastAccess[SESSION*DateTime]
* Add codebase of new developed frontend. Not integrated in building image yet.
Expand Down
4 changes: 2 additions & 2 deletions src/Ampersand/Controller/ResourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Ampersand\Core\Concept;
use Ampersand\Exception\AccessDeniedException;
use Ampersand\Exception\BadRequestException;
use Ampersand\Exception\NotDefined\ConceptNotDefined;
use Ampersand\Exception\NotDefined\ConceptNotDefinedException;
use Ampersand\Exception\FatalException;
use Ampersand\Exception\MethodNotAllowedException;
use Ampersand\Interfacing\Options;
Expand Down Expand Up @@ -177,7 +177,7 @@ public function renameAtoms(Request $request, Response $response, array $args):

$resourceType = $args['resourceType'];
if (!$this->app->getModel()->getConcept($resourceType)->isObject()) {
throw new ConceptNotDefined("Resource type '{$resourceType}' not found");
throw new ConceptNotDefinedException("Resource type '{$resourceType}' not found");
}

$list = $request->reparseBody()->getParsedBody();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

use Ampersand\Exception\NotDefined\NotDefinedException;

class ConceptNotDefined extends NotDefinedException
class ConceptNotDefinedException extends NotDefinedException
{
}
6 changes: 3 additions & 3 deletions src/Ampersand/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
use Ampersand\Core\Link;
use Ampersand\Core\Atom;
use Ampersand\Exception\AmpersandException;
use Ampersand\Exception\NotDefined\ConceptNotDefined;
use Ampersand\Exception\NotDefined\ConceptNotDefinedException;
use Ampersand\Exception\NotDefined\ConjunctNotDefinedException;
use Ampersand\Exception\FatalException;
use Ampersand\Exception\NotDefined\RelationNotDefined;
Expand Down Expand Up @@ -345,7 +345,7 @@ public function getAllConcepts(): array
public function getConcept(string $conceptId): Concept
{
if (!array_key_exists($conceptId, $concepts = $this->getAllConcepts())) {
throw new ConceptNotDefined("Concept '{$conceptId}' is not defined");
throw new ConceptNotDefinedException("Concept '{$conceptId}' is not defined");
}

return $concepts[$conceptId];
Expand All @@ -364,7 +364,7 @@ public function getConceptByLabel(string $conceptLabel): Concept
}
}

throw new ConceptNotDefined("Concept '{$conceptLabel}' is not defined");
throw new ConceptNotDefinedException("Concept '{$conceptLabel}' is not defined");
}

public function getSessionConcept(): Concept
Expand Down

0 comments on commit a336052

Please sign in to comment.