Skip to content

Commit

Permalink
rename exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed Jan 2, 2019
1 parent 6161ecc commit a37b6d5
Show file tree
Hide file tree
Showing 28 changed files with 135 additions and 135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@

namespace Prooph\EventStore\Exception;

class AccessDeniedException extends RuntimeException
class AccessDenied extends RuntimeException
{
public static function toAllStream(): AccessDeniedException
public static function toAllStream(): AccessDenied
{
return new self(\sprintf(
'Access to stream \'%s\' is denied',
'$all'
));
}

public static function toStream(string $stream): AccessDeniedException
public static function toStream(string $stream): AccessDenied
{
return new self(\sprintf(
'Access to stream \'%s\' is denied',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

namespace Prooph\EventStore\Exception;

class OperationTimedOutException extends RuntimeException
class CannotEstablishConnection extends RuntimeException
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace Prooph\EventStore\Exception;

class ConnectionClosedException extends EventStoreConnectionException
class ConnectionClosed extends EventStoreConnectionException
{
public static function withName(string $name): ConnectionClosedException
public static function withName(string $name): ConnectionClosed
{
return new self(\sprintf(
'Connection \'%s\' was closed',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
* Exception thrown if there is an attempt to operate inside a
* transaction which does not exist.
*/
class InvalidTransactionException extends RuntimeException
class InvalidTransaction extends RuntimeException
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace Prooph\EventStore\Exception;

class MaxQueueSizeLimitReachedException extends RuntimeException
class MaxQueueSizeLimitReached extends RuntimeException
{
public static function with(string $connectionName, int $maxQueueSize): MaxQueueSizeLimitReachedException
public static function with(string $connectionName, int $maxQueueSize): MaxQueueSizeLimitReached
{
return new self(
\sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

namespace Prooph\EventStore\Exception;

class ObjectDisposedException extends InvalidOperationException
class MaximumSubscribersReached extends RuntimeException
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Prooph\EventStore\Exception;

class NotAuthenticatedException extends RuntimeException
class NotAuthenticated extends RuntimeException
{
public function __construct(string $message = 'Not authenticated')
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

namespace Prooph\EventStore\Exception;

class CannotEstablishConnectionException extends RuntimeException
class ObjectDisposed extends InvalidOperationException
{
}
18 changes: 18 additions & 0 deletions src/Exception/OperationTimedOut.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

/**
* This file is part of prooph/event-store.
* (c) 2014-2019 prooph software GmbH <contact@prooph.de>
* (c) 2015-2019 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\EventStore\Exception;

class OperationTimedOut extends RuntimeException
{
}
18 changes: 18 additions & 0 deletions src/Exception/PersistentSubscriptionCommandFailed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

/**
* This file is part of prooph/event-store.
* (c) 2014-2019 prooph software GmbH <contact@prooph.de>
* (c) 2015-2019 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\EventStore\Exception;

class PersistentSubscriptionCommandFailed extends EventStoreConnectionException
{
}
18 changes: 0 additions & 18 deletions src/Exception/PersistentSubscriptionCommandFailedException.php

This file was deleted.

18 changes: 18 additions & 0 deletions src/Exception/PersistentSubscriptionDeleted.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

/**
* This file is part of prooph/event-store.
* (c) 2014-2019 prooph software GmbH <contact@prooph.de>
* (c) 2015-2019 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\EventStore\Exception;

class PersistentSubscriptionDeleted extends RuntimeException
{
}
18 changes: 0 additions & 18 deletions src/Exception/PersistentSubscriptionDeletedException.php

This file was deleted.

18 changes: 18 additions & 0 deletions src/Exception/ProjectionCommandConflict.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

/**
* This file is part of prooph/event-store.
* (c) 2014-2019 prooph software GmbH <contact@prooph.de>
* (c) 2015-2019 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\EventStore\Exception;

class ProjectionCommandConflict extends ProjectionCommandFailed
{
}
18 changes: 0 additions & 18 deletions src/Exception/ProjectionCommandConflictException.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

namespace Prooph\EventStore\Exception;

class MaximumSubscribersReachedException extends RuntimeException
class ProjectionCommandFailed extends EventStoreConnectionException
{
}
18 changes: 0 additions & 18 deletions src/Exception/ProjectionCommandFailedException.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace Prooph\EventStore\Exception;

class RetriesLimitReachedException extends RuntimeException
class RetriesLimitReached extends RuntimeException
{
public static function with(int $retries): RetriesLimitReachedException
public static function with(int $retries): RetriesLimitReached
{
return new self(
\sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace Prooph\EventStore\Exception;

class StreamDeletedException extends RuntimeException
class StreamDeleted extends RuntimeException
{
public static function with(string $stream): StreamDeletedException
public static function with(string $stream): StreamDeleted
{
return new self(\sprintf(
'Stream \'%s\' is deleted',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

namespace Prooph\EventStore\Exception;

class TimeoutException extends RuntimeException
class Timeout extends RuntimeException
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@

namespace Prooph\EventStore\Exception;

class UnexpectedCommandException extends RuntimeException
class UnexpectedCommand extends RuntimeException
{
public static function withName(string $actualCommand): UnexpectedCommandException
public static function withName(string $actualCommand): UnexpectedCommand
{
return new self(\sprintf(
'Unexpected command \'%s\'',
$actualCommand
));
}

public static function with(string $expectedCommand, string $actualCommand): UnexpectedCommandException
public static function with(string $expectedCommand, string $actualCommand): UnexpectedCommand
{
return new self(\sprintf(
'Unexpected command \'%s\': expected \'%s\'',
Expand Down
18 changes: 18 additions & 0 deletions src/Exception/UserCommandConflict.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

/**
* This file is part of prooph/event-store.
* (c) 2014-2019 prooph software GmbH <contact@prooph.de>
* (c) 2015-2019 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\EventStore\Exception;

class UserCommandConflict extends ProjectionCommandFailed
{
}
18 changes: 0 additions & 18 deletions src/Exception/UserCommandConflictException.php

This file was deleted.

18 changes: 18 additions & 0 deletions src/Exception/UserCommandFailed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

/**
* This file is part of prooph/event-store.
* (c) 2014-2019 prooph software GmbH <contact@prooph.de>
* (c) 2015-2019 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\EventStore\Exception;

class UserCommandFailed extends EventStoreConnectionException
{
}
18 changes: 0 additions & 18 deletions src/Exception/UserCommandFailedException.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

namespace Prooph\EventStore\Exception;

class WrongExpectedVersionException extends RuntimeException
class WrongExpectedVersion extends RuntimeException
{
public static function with(
string $stream,
int $expectedVersion,
?int $currentVersion = null
): WrongExpectedVersionException {
): WrongExpectedVersion {
$message = 'Operation failed due to WrongExpectedVersion. Stream: \'%s\', Expected version: %d';

if (null !== $currentVersion) {
Expand Down
Loading

0 comments on commit a37b6d5

Please sign in to comment.