src/POData/Writers/Json/JsonODataV1Writer.php
/**
     * serialize exception.
     *
     * @param ODataException $exception              Exception to serialize
     * @param Boolean        $serializeInnerException if set to true
     *
     * serialize the inner exception if $exception is an ODataException.
     *
     * @return string
     */
serialize exception.
@param ODataException $exception              Exception to serialize
@param Boolean        $serializeInnerException if set to true

serialize the inner exception if $exception is an ODataException.

@return string
serialize exception . @param ODataException $exception Exception to serialize @param Boolean $serializeInnerException if set to true serialize the inner exception if $exception is an ODataException . @return string
public static function serializeException(ODataException $exception, $serializeInnerException)
    {
        $writer = new JsonWriter('');
        $writer
	        ->startObjectScope()
            ->writeName(ODataConstants::JSON_ERROR) 
            ->startObjectScope();
        if ($exception->getCode() != null) {
            $writer
	            ->writeName(ODataConstants::JSON_ERROR_CODE)
	            ->writeValue($exception->getCode());
        }
        $writer
	        ->writeName(ODataConstants::JSON_ERROR_MESSAGE)
	        ->startObjectScope()
	        ->writeName(ODataConstants::XML_LANG_ATTRIBUTE_NAME) 
	        ->writeValue('en-US')
            ->writeName(ODataConstants::JSON_ERROR_VALUE)
	        ->writeValue($exception->getMessage())
	        ->endScope()
	        ->endScope()
	        ->endScope();
        return $writer->getJsonOutput();
    }
public static function serializeException ( ODataException $ exception , $ serializeInnerException ) { $ writer = new JsonWriter ( '' ) ; $ writer -> startObjectScope ( ) -> writeName ( ODataConstants :: JSON_ERROR ) -> startObjectScope ( ) ; if ( $ exception -> getCode ( ) != null ) { $ writer -> writeName ( ODataConstants :: JSON_ERROR_CODE ) -> writeValue ( $ exception -> getCode ( ) ) ; } $ writer -> writeName ( ODataConstants :: JSON_ERROR_MESSAGE ) -> startObjectScope ( ) -> writeName ( ODataConstants :: XML_LANG_ATTRIBUTE_NAME ) -> writeValue ( 'en-US' ) -> writeName ( ODataConstants :: JSON_ERROR_VALUE ) -> writeValue ( $ exception -> getMessage ( ) ) -> endScope ( ) -> endScope ( ) -> endScope ( ) ; return $ writer -> getJsonOutput ( ) ; }
serialize exception.
serialize exception .
// Wrapper for error. // "error" // "code" // "message" // "lang"