Skip to content

Implement ResourceAlreadyExistsException #178

@DenTray

Description

@DenTray

Description

What needs to be done?

Create a new exception class ResourceAlreadyExistsException that extends the base Exception class. This class must have a constructor with three parameters:

  • entityName (string) — the name of the entity.

  • resourceType (of type ResourceTypeEnum) — the type of resource.

  • entityNamespace (string|null) — optional, default value is null.

The constructor should automatically set the exception message using the template:
Cannot create {$entity}{$resourceType} cause it already exists. Remove {$entity}{$resourceType} and run command again.
Also, create an enum class ResourceTypeEnum inside the src/Enums directory with the following cases:

  • Controller

  • Factory

  • Model

  • NovaResource

  • NovaTest

  • Resource

  • CollectionResource

Ensure proper usage of the enum type for the $resourceType argument in the exception class constructor.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions