class ExceptionRepresentation extends MappingRepresentation {

    @Override
    protected void serialize( MappingSerializer serializer )
    {
        // For legacy reasons, this actually serializes into two separate formats - the old format, which simply
        // serializes a single exception, and the new format which serializes multiple errors and provides simple
        // status codes.
        if ( includeLegacyRepresentation )
        {
            renderWithLegacyFormat( errors.get( 0 ).cause(), serializer );
        }

        renderWithStatusCodeFormat( serializer );
    }

    public  ExceptionRepresentation( Throwable exception );
    public  ExceptionRepresentation( Throwable exception, boolean includeLegacyRepresentation );
    public  ExceptionRepresentation( Neo4jError ... errors );

}