|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
* This file is automatically generated. |
|
4
|
|
|
*/ |
|
5
|
|
|
|
|
6
|
|
|
namespace ButterAMQP\Exception; |
|
7
|
|
|
|
|
8
|
|
|
class AMQPException extends \Exception |
|
9
|
|
|
{ |
|
10
|
5 |
|
public static function make($message, $code) |
|
11
|
|
|
{ |
|
12
|
|
|
switch ($code) { |
|
13
|
5 |
|
case 311: |
|
14
|
|
|
return new AMQP\ContentTooLargeException($message, $code); |
|
15
|
5 |
|
case 313: |
|
16
|
|
|
return new AMQP\NoConsumersException($message, $code); |
|
17
|
5 |
|
case 320: |
|
18
|
1 |
|
return new AMQP\ConnectionForcedException($message, $code); |
|
19
|
4 |
|
case 402: |
|
20
|
|
|
return new AMQP\InvalidPathException($message, $code); |
|
21
|
4 |
|
case 403: |
|
22
|
1 |
|
return new AMQP\AccessRefusedException($message, $code); |
|
23
|
3 |
|
case 404: |
|
24
|
2 |
|
return new AMQP\NotFoundException($message, $code); |
|
25
|
1 |
|
case 405: |
|
26
|
|
|
return new AMQP\ResourceLockedException($message, $code); |
|
27
|
1 |
|
case 406: |
|
28
|
1 |
|
return new AMQP\PreconditionFailedException($message, $code); |
|
29
|
|
|
case 501: |
|
30
|
|
|
return new AMQP\FrameErrorException($message, $code); |
|
31
|
|
|
case 502: |
|
32
|
|
|
return new AMQP\SyntaxErrorException($message, $code); |
|
33
|
|
|
case 503: |
|
34
|
|
|
return new AMQP\CommandInvalidException($message, $code); |
|
35
|
|
|
case 504: |
|
36
|
|
|
return new AMQP\ChannelErrorException($message, $code); |
|
37
|
|
|
case 505: |
|
38
|
|
|
return new AMQP\UnexpectedFrameException($message, $code); |
|
39
|
|
|
case 506: |
|
40
|
|
|
return new AMQP\ResourceErrorException($message, $code); |
|
41
|
|
|
case 530: |
|
42
|
|
|
return new AMQP\NotAllowedException($message, $code); |
|
43
|
|
|
case 540: |
|
44
|
|
|
return new AMQP\NotImplementedException($message, $code); |
|
45
|
|
|
case 541: |
|
46
|
|
|
return new AMQP\InternalErrorException($message, $code); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
return new self($message, $code); |
|
50
|
|
|
} |
|
51
|
|
|
} |
|
52
|
|
|
|