Skip to content

Commit

Permalink
Created HTTP Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
CommandString committed May 24, 2023
1 parent 0c03513 commit 24def17
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Exceptions/HttpException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Tnapf\Spotify\Exceptions;

use Exception;
use Tnapf\Spotify\Abstractions\Errors\AuthenticationError;
use Tnapf\Spotify\Abstractions\Errors\Error;

class HttpException extends Exception
{
public function __construct(
public readonly Error|AuthenticationError $error,
?Throwable $previous = null
) {
parent::__construct($error->message ?? $error->error, $error->status ?? 0, $previous);
}
}

0 comments on commit 24def17

Please sign in to comment.