You are here

public function LockrApiException::divineCode in Lockr 7.3

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

File

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

Class

LockrApiException

Namespace

Lockr\Exception

Code

public function divineCode() {
  foreach ($this->errors as $err) {
    if (!empty($err['extensions']['status_code'])) {
      return (int) $err['extensions']['status_code'];
    }
  }
  return 0;
}