refused-exception.php
18 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Thrown when a query is refused before reaching the AI (usage limits, banned |
| 5 | * IPs or words, or any mwai_ai_allowed filter). Unlike provider errors, the |
| 6 | * message is written for the end user and safe to display as-is. The reason |
| 7 | * lets REST layers attach machine-readable flags (e.g. overLimit) so clients |
| 8 | * can react beyond showing the message, like locking the chat input. |
| 9 | */ |
| 10 | class Meow_MWAI_RefusedException extends Exception { |
| 11 | public $reason = null; |
| 12 | |
| 13 | public function __construct( $message, $reason = null ) { |
| 14 | parent::__construct( $message ); |
| 15 | $this->reason = $reason; |
| 16 | } |
| 17 | } |
| 18 |