You are here

public function LockrApiException::buildMessage in Lockr 7.3

1 call to LockrApiException::buildMessage()
LockrApiException::__construct in vendor/lockr/lockr/src/Exception/LockrApiException.php

File

vendor/lockr/lockr/src/Exception/LockrApiException.php, line 27

Class

LockrApiException

Namespace

Lockr\Exception

Code

public function buildMessage() {
  if (!$this->errors) {
    return '';
  }
  $err = $this->errors[0];
  $msg = $err['message'];
  if (count($this->errors) > 1) {
    $extra = count($this->errors) - 1;
    $msg .= " (and {$extra} more)";
  }
  return $msg;
}