mirror of
https://github.com/flarum/core.git
synced 2025-10-09 14:06:26 +02:00
Improve error handling somewhat
- Fix composer crashing/not showing alert on error - Make a general ValidationException which takes an array of field ⇒ messages to be outputted nicely by the API
This commit is contained in:
18
src/Core/Exceptions/ValidationException.php
Normal file
18
src/Core/Exceptions/ValidationException.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php namespace Flarum\Core\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class ValidationException extends Exception
|
||||
{
|
||||
protected $messages;
|
||||
|
||||
public function __construct(array $messages)
|
||||
{
|
||||
$this->messages = $messages;
|
||||
}
|
||||
|
||||
public function getMessages()
|
||||
{
|
||||
return $this->messages;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user