Skip to content

Commit 2ac1a89

Browse files
added new type of exception
1 parent 55a3758 commit 2ac1a89

File tree

5 files changed

+31
-10
lines changed

5 files changed

+31
-10
lines changed

src/error/IgnoredException.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace Bolt\error;
4+
5+
use Exception;
6+
7+
/**
8+
* Class IgnoreException
9+
*
10+
* @author Michal Stefanak
11+
* @link https://github.com/neo4j-php/Bolt
12+
* @package Bolt\error
13+
*/
14+
class IgnoredException extends Exception
15+
{
16+
17+
}

src/protocol/V1.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Bolt\protocol;
44

5+
use Bolt\error\IgnoredException;
56
use Bolt\error\MessageException;
67
use Bolt\error\PackException;
78
use Exception;
@@ -71,7 +72,7 @@ public function run(...$args): array
7172
}
7273

7374
if ($signature == self::IGNORED) {
74-
throw new MessageException('RUN message IGNORED. Server in FAILED or INTERRUPTED state.');
75+
throw new IgnoredException('RUN message IGNORED. Server in FAILED or INTERRUPTED state.');
7576
}
7677

7778
return $message;
@@ -103,7 +104,7 @@ public function pullAll(...$args): array
103104
}
104105

105106
if ($signature == self::IGNORED) {
106-
throw new MessageException('PULL_ALL message IGNORED. Server in FAILED or INTERRUPTED state.');
107+
throw new IgnoredException('PULL_ALL message IGNORED. Server in FAILED or INTERRUPTED state.');
107108
}
108109

109110
return $output;
@@ -129,7 +130,7 @@ public function discardAll(...$args): array
129130
}
130131

131132
if ($signature == self::IGNORED) {
132-
throw new MessageException('DISCARD_ALL message IGNORED. Server in FAILED or INTERRUPTED state.');
133+
throw new IgnoredException('DISCARD_ALL message IGNORED. Server in FAILED or INTERRUPTED state.');
133134
}
134135

135136
return $message;

src/protocol/V3.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Bolt\protocol;
44

5+
use Bolt\error\IgnoredException;
56
use Bolt\error\MessageException;
67
use Bolt\error\PackException;
78
use Exception;
@@ -82,7 +83,7 @@ public function run(...$args): array
8283
}
8384

8485
if ($signature == self::IGNORED) {
85-
throw new MessageException('RUN message IGNORED. Server in FAILED or INTERRUPTED state.');
86+
throw new IgnoredException('RUN message IGNORED. Server in FAILED or INTERRUPTED state.');
8687
}
8788

8889
return $message;
@@ -109,7 +110,7 @@ public function begin(...$args): array
109110
}
110111

111112
if ($signature == self::IGNORED) {
112-
throw new MessageException('BEGIN message IGNORED. Server in FAILED or INTERRUPTED state.');
113+
throw new IgnoredException('BEGIN message IGNORED. Server in FAILED or INTERRUPTED state.');
113114
}
114115

115116
return $message;
@@ -133,7 +134,7 @@ public function commit(): array
133134
}
134135

135136
if ($signature == self::IGNORED) {
136-
throw new MessageException('COMMIT message IGNORED. Server in FAILED or INTERRUPTED state.');
137+
throw new IgnoredException('COMMIT message IGNORED. Server in FAILED or INTERRUPTED state.');
137138
}
138139

139140
return $message;
@@ -157,7 +158,7 @@ public function rollback(): array
157158
}
158159

159160
if ($signature == self::IGNORED) {
160-
throw new MessageException('ROLLBACK message IGNORED. Server in FAILED or INTERRUPTED state.');
161+
throw new IgnoredException('ROLLBACK message IGNORED. Server in FAILED or INTERRUPTED state.');
161162
}
162163

163164
return $message;

src/protocol/V4.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Bolt\protocol;
44

5+
use Bolt\error\IgnoredException;
56
use Exception;
67
use Bolt\error\MessageException;
78

@@ -55,7 +56,7 @@ public function pull(...$args): array
5556
}
5657

5758
if ($signature == self::IGNORED) {
58-
throw new MessageException('PULL message IGNORED. Server in FAILED or INTERRUPTED state.');
59+
throw new IgnoredException('PULL message IGNORED. Server in FAILED or INTERRUPTED state.');
5960
}
6061

6162
return $output;
@@ -94,7 +95,7 @@ public function discard(...$args): array
9495
}
9596

9697
if ($signature == self::IGNORED) {
97-
throw new MessageException('DISCARD message IGNORED. Server in FAILED or INTERRUPTED state.');
98+
throw new IgnoredException('DISCARD message IGNORED. Server in FAILED or INTERRUPTED state.');
9899
}
99100

100101
return $message;

src/protocol/V4_3.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Bolt\protocol;
44

5+
use Bolt\error\IgnoredException;
56
use Bolt\error\MessageException;
67
use Bolt\error\PackException;
78
use Exception;
@@ -40,7 +41,7 @@ public function route(...$args): array
4041
}
4142

4243
if ($signature == self::IGNORED) {
43-
throw new MessageException('ROUTE message IGNORED. Server in FAILED or INTERRUPTED state.');
44+
throw new IgnoredException('ROUTE message IGNORED. Server in FAILED or INTERRUPTED state.');
4445
}
4546

4647
return $message;

0 commit comments

Comments
 (0)