Adapted error handling.
Added:
Chubbyphp\Parsing\ErrorsChubbyphp\Parsing\ErrorsException
Removed:
Chubbyphp\Parsing\ParserErrorExceptionChubbyphp\Parsing\ParserErrorExceptionToString
old:
<?php
declare(strict_types=1);
namespace App;
use Chubbyphp\Parsing\Parser;
use Chubbyphp\Parsing\ParserErrorException;
$p = new Parser();
$schema = $p->string();
try {
$schema->parse('test');
} catch (ParserErrorException $e) {
var_dump($e->getApiProblemErrorMessages());
}new
<?php
declare(strict_types=1);
namespace App;
use Chubbyphp\Parsing\ErrorsException;
use Chubbyphp\Parsing\Parser;
$p = new Parser();
$schema = $p->string();
try {
$schema->parse('test');
} catch (ErrorsException $e) {
var_dump($e->errors->toApiProblemInvalidParameters());
}