Error display format

Asked by Henrik Ziegeldorf

I am writing a small plugin that checks commits for specific criteria.
It runs on the server and should report back to the user if an error occurred.
The protocol being used is bzr+ssh.

How can I report back to the user with a formatted error message?
If I use like raise errors.BzrErrors("line1 \n line2 ... ") the errormessage is very hard to read at the user's end, because linebreaks are not displayed correctly.

Any suggestions?

Thank you!

Question information

English Edit question
Bazaar Edit question
No assignee Edit question
Solved by:
Andrew Bennetts
Last query:
Last reply:
Revision history for this message
Best Andrew Bennetts (spiv) said :

Use the Branch.pre_change_branch_tip hook point, and have your hook function raise TipChangeRejected. TipChangeRejected errors from that hook will be shown cleanly to the client, even over bzr+ssh.

See <> and <>.

Let us know if you need more guidance.

Revision history for this message
Henrik Ziegeldorf (henrik-ziegeldorf) said :

Thanks Andrew Bennetts, that solved my question.