Skip to content

Commit

Permalink
add custom exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
xHeaven committed May 1, 2024
1 parent 25d5dea commit f168c01
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Exceptions/FailedToEncodeException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace Luminarix\JSONL\Exceptions;

use Exception;

/**
* The exception that is thrown when an object cannot be encoded to a JSONL row.
*/
class FailedToEncodeException extends Exception
{
}
14 changes: 14 additions & 0 deletions src/Exceptions/FailedToOpenFileException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace Luminarix\JSONL\Exceptions;

use Exception;

/**
* The exception that is thrown when a file cannot be opened.
*/
class FailedToOpenFileException extends Exception
{
}
14 changes: 14 additions & 0 deletions src/Exceptions/FailedToWriteFileException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace Luminarix\JSONL\Exceptions;

use Exception;

/**
* The exception that is thrown when a file cannot be written.
*/
class FailedToWriteFileException extends Exception
{
}
14 changes: 14 additions & 0 deletions src/Exceptions/InvalidDtoClassException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace Luminarix\JSONL\Exceptions;

use Exception;

/**
* The exception that is thrown when a DTO class is invalid.
*/
class InvalidDtoClassException extends Exception
{
}
14 changes: 14 additions & 0 deletions src/Exceptions/InvalidRowException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace Luminarix\JSONL\Exceptions;

use Exception;

/**
* The exception that is thrown when a JSONL row is invalid.
*/
class InvalidRowException extends Exception
{
}

0 comments on commit f168c01

Please sign in to comment.