Get the exception as an associative array.

<pre>
{
'type'  => (string)
'error' => (string)
'code'  => (int)
'file'  => (string)
'line'  => (int)
'trace' => (array)
'inner' => (array)
}
</pre>

@return array
553481
public function toArray() {
        $exception = [
            'type'  => static::class,
            'error' => $this->getMessage(),
            'code'  => $this->getCode(),
            'line'  => $this->getLine(),
            'file'  => $this->getFile(),
            'trace' => $this->getTrace(),
            'inner' => null
        ];

        $prev  = $this->getPrevious();
        $inner = &$exception['inner'];
        while ($prev !== null) {

            if ($prev instanceof JitesoftException) {
                // If inner is a jitesoftexception, we can fetch the inner exception
                // as an array, and due to the fact that there is only one inner exception,
                // it will take care of the nesting in its own toArray method.
                $inner = $prev->toArray();
                break;
            }

            $inner = [
                'type'  => get_class($prev),
                'error' => $prev->getMessage(),
                'code'  => $prev->getCode(),
                'line'  => $prev->getLine(),
                'file'  => $prev->getFile(),
                'trace' => $prev->getTrace(),
                'inner' => ($prev->getPrevious() !== null ? [] : null)
            ];

            $inner = &$inner['inner'];
            $prev  = $prev->getPrevious();
        }

        return $exception;
    }
776755
protected function createDetailFromException()
    {
        $e = $this->detail;

        if (!$this->detailIncludesStackTrace) {
            return $this->getExceptionMessage($e);
        }

        $message = $this->getExceptionMessage($e);
        $this->additionalDetails['trace'] = $e->getTrace();

        $previous = [];
        $e = $e->getPrevious();
        while ($e) {
            $previous[] = [
                'code'    => (int) $e->getCode(),
                'message' => $this->getExceptionMessage($e),
                'trace'   => $e->getTrace(),
            ];
            $e = $e->getPrevious();
        }
        if (count($previous)) {
            $this->additionalDetails['exception_stack'] = $previous;
        }

        return $message;
    }
1074080
public function getFiles()
    {

        $filenames = array();

        if ( ! $this->exists() ) {
            throw new \Exception("file '" . $this->m_sPath . "' does not exist.");
        }

        if ($oDirectoryHandle = opendir($this->m_sPath)) {
            while (false !== ($filename = readdir($oDirectoryHandle))) {
                if ($filename != "." && $filename != ".." && (!is_dir($this->m_sPath . "/" . $filename))) {
	                array_push($filenames, $filename);
                }
            }
	        asort($filenames);

	        $filewebfiles = array();
	        foreach ($filenames as $filename) {
		        $filewebfile = new MFile($this->getPath() . "/" . $filename);
		        array_push($filewebfiles, $filewebfile);
	        }
	        return $filewebfiles;
        }


    }
819542
public function __toArray()
    {
        $result = [];
        foreach ($this->errors as $idx => $oneError) {
            $result[] = $oneError->__toArray();
        }
        return $result;
    }
172636
protected function convertExceptionToArray(Exception $e)
    {
        return config('app.debug') ? [
            'message' => $e->getMessage(),
            'exception' => get_class($e),
            'file' => $e->getFile(),
            'line' => $e->getLine(),
            'trace' => collect($e->getTrace())->map(function ($trace) {
                return Arr::except($trace, ['args']);
            })->all(),
        ] : [
            'message' => $this->isHttpException($e) ? $e->getMessage() : 'Server Error',
        ];
    }
1370092
public function toArray()
    {
        return [
            'fileId' => $this->file->getId(),
            'fileVersion' => $this->file->getVersion(),
            'usageType' => $this->usageType,
            'usageId' => $this->usageId,
            'status' => $this->status,
        ];
    }
947021
public function getDescription()
    {
        return class_basename($this->exception).
            ' line '.$this->exception->getLine().
            ' in '.$this->exception->getFile();
    }
947582
protected function convertExceptionToArray(Exception $e)
    {
        return $this->container->make('config')->get('app.debug') ? [
            'message' => $e->getMessage(),
            'exception' => get_class($e),
            'file' => $e->getFile(),
            'line' => $e->getLine(),
            'trace' => collect($e->getTrace())->map(function ($trace) {
                return Arr::except($trace, ['args']);
            })->all(),
        ] : [
            'message' => $this->isServiceException($e) ? $e->getMessage() : 'Server Error',
        ];
    }
99950
protected function getLines()
    {
        $ret = file($this->fileName);
        if ($ret === false) {
            throw new Exception('Unable to read file');
        }
        $lines = array();
        foreach ($ret as $line) {
            $lines[] = rtrim($line);
        }

        return $lines;
    }
1289890
protected function getExceptionMessageAppendix()
    {
        $tmp = [];
        if ($this->sourceBlueprint) { $tmp[] = 'Blueprint: ' . $this->sourceBlueprint->getName(); }
        if ($this->sourceType) { $tmp[] = 'Type:' . $this->sourceType; }
        if ($this->sourceKey) { $tmp[] = 'Key:' . $this->sourceKey; }
        if (count($tmp)) {
            return ' (' . implode(', ', $tmp) . ')';
        }
        return '';
    }
714954
public function toArray(): array
    {
        $return = [];
        foreach ($this as $row) {
            if (is_array($row)) {
                $return[] = $row;
            } elseif (method_exists($row, 'toArray')) {
                $return[] = $row->toArray();
            } elseif (method_exists($row, 'getArrayCopy')) {
                $return[] = $row->getArrayCopy();
            } else {
                throw new Exception\RuntimeException(
                    __METHOD__ . ': Rows as part of this DataSource, with type ' . gettype($row) . ' cannot be cast to an array'
                );
            }
        }

        return $return;
    }
1150989
public function getResultsAsArray()
    {
        $new = array();
        foreach ((array) $this->results as $result) {
            if ($result instanceof Object)
                $new[] = $result->toArray();
            else if (is_array($result))
                return $this->results;
            else
                throw new Exception('Cannot convert to array: '.ClassUtils::getQualifiedType($result));
        }
        return $new;
    }
893799
protected function getExceptionCode()
    {
        $exception = $this->getException();

        $code = $exception->getCode();
        if ($exception instanceof \ErrorException) {
            // ErrorExceptions wrap the php-error types within the 'severity' property
            $code = Misc::translateErrorCode($exception->getSeverity());
        }

        return (string) $code;
    }
68779
public function toArray() : array
    {
        $result = [];

        if (!empty($this->id)) {
            $result['id'] = $this->id;
        }

        if (!empty($this->link)) {
            $result['links']['about'] = $this->link;
        }

        if (!empty($this->status)) {
            $result['status'] = "{$this->status}";
        }

        if (!empty($this->code)) {
            $result['code'] = "{$this->code}";
        }

        if (!empty($this->title)) {
            $result['title'] = $this->title;
        }

        if (!empty($this->detail)) {
            $result['detail'] = $this->detail;
        }

        if (!empty($this->source)) {
            $result['source'] = $this->source->map(function ($item) {
                return $item;
            });
        }

        if (!empty($this->meta)) {
            $result['meta'] = $this->meta;
        }

        if (!empty($this->exception)) {
            $e = $this->exception;
            if ($e instanceof ExtendedLoggingInformation) {
                $result['exception'] = $e->context();
            } else {
                $result['exception'] = [
                    'exception' => get_class($e),
                    'message' => $e->getMessage(),
                    'stacktrace' => $e->getTrace(),
                ];
            }
        }

        return $result;
    }
598675
protected function getExceptionCode()
    {
        $exception = $this->getException();

        if ($exception instanceof HttpException) {
            return $exception->statusCode;
        }

        return $exception->getCode();
    }
1280779
public function getArray()
  {
    $errors = empty($this->errors) ? null : $this->errors;

    $response = array(
        'status' => $this->getStatus(),
        'data'   => $this->data,
        'errors' => $errors,
    );

    if (!is_null($this->code)) {
      $response['code'] = $this->code;
    }

    if (!is_null($this->message)) {
      $response['message'] = $this->message;
    }

    return $response;
  }
1361344
public function getException($exception)
    {
        return array(
          'type' => 'exception',
          'tid' => $this->tid,
          'action' => $this->action,
          'method' => $this->method,
          'message' => $exception->getMessage(),
          'where' => $exception->getTraceAsString()
        );
    }