You are here

protected function FeedsExJsonPath::getErrors in Feeds extensible parsers 7

Same name and namespace in other branches
  1. 7.2 src/FeedsExJsonPath.inc \FeedsExJsonPath::getErrors()

Returns the errors after parsing.

Return value

array A structured array array with keys:

  • message: The error message.
  • variables: The variables for the message.
  • severity: The severity of the message.

Overrides FeedsExBase::getErrors

See also

watchdog()

File

src/FeedsExJsonPath.inc, line 98
Contains FeedsExJsonPath.

Class

FeedsExJsonPath
Parses JSON via JSONPath.

Code

protected function getErrors() {
  if (!function_exists('json_last_error')) {
    return array();
  }
  if (!($error = json_last_error())) {
    return array();
  }
  $message = array(
    'message' => FeedsExJsonUtility::translateError($error),
    'variables' => array(),
    'severity' => WATCHDOG_ERROR,
  );
  return array(
    $message,
  );
}