private function buildExceptions($exceptions)
{
if (count($exceptions) === 0) {
return $exceptions;
}
$exceptionsArray = [];
foreach ($exceptions as $exception) {
$exceptionsArray[] = ['type' => $exception->getType(), 'description' => $exception->getDescription()];
}
return $exceptionsArray;
}