'error( trans, id )
* POST /api/jobs/{id}/error
submits a bug report via the API.
:type   id: string
:param  id: Encoded job id
:rtype:     dictionary
:returns:   dictionary containing information regarding where the error report was sent.'

@expose_api
def error(self, trans, id, **kwd):

    try:
        decoded_dataset_id = self.decode_id(kwd['dataset_id'])
    except Exception:
        raise exceptions.MalformedId()
    dataset = trans.sa_session.query(trans.app.model.HistoryDatasetAssociation).get(decoded_dataset_id)
    job = self.__get_job(trans, id)
    tool = (trans.app.toolbox.get_tool(job.tool_id, tool_version=job.tool_version) or None)
    messages = trans.app.error_reports.default_error_plugin.submit_report(dataset, job, tool, user_submission=True, user=trans.user, email=kwd.get('email', trans.user.email), message=kwd.get('message', None))
    return {'messages': messages}
