Re: [Monotone-devel] Error handling via automate

2006-09-11 Thread Jon Bright
Nathaniel Smith wrote: (In fact 'automate stdio' makes me quite nervous for this reason already. I would feel better if part of its contract was that it would exit after an error, and it was the client's responsibility to restart it.) Speaking as someone who's writing something to use

Re: [Monotone-devel] Error handling via automate

2006-09-11 Thread Thomas Keller
Jon Bright schrieb: Nathaniel Smith wrote: (In fact 'automate stdio' makes me quite nervous for this reason already. I would feel better if part of its contract was that it would exit after an error, and it was the client's responsibility to restart it.) Speaking as someone who's writing

Re: [Monotone-devel] Error handling via automate

2006-09-11 Thread Nathaniel Smith
On Mon, Sep 11, 2006 at 12:55:36PM +0200, Jon Bright wrote: Thomas Keller wrote: This, however, doesn't solve at all the problem how a client application should be able to weight the fatalness of an error. Right. Being that the current error handling doesn't have any knowledge about

Re: [Monotone-devel] Error handling via automate

2006-09-10 Thread Thomas Keller
Nathaniel Smith schrieb: Another possibility in this particular case would be automate update simply require that the caller provide the target revision; then this error can't happen. Instead, the caller would go to get the target for the update, discover there were multiple candidates, and

Re: [Monotone-devel] Error handling via automate

2006-09-10 Thread Thomas Keller
Daniel Carosone schrieb: Would an 'automate' locale/translation, with machine-friendly messages like this, be unreasonable? I'd vote for that, definitely. Thomas. -- - I know that I don't know. (Sokrates) Guitone, a frontend for monotone: http://guitone.berlios.de Music lyrics and more:

Re: [Monotone-devel] Error handling via automate

2006-09-10 Thread Thomas Keller
Timothy Brownawell schrieb: Probably, yes. I don't really think that's the kind of thing gettext is designed for. (Also, AIUI, using gettext would require that you actually *install* monotone, so the translation files get put in the right place. Probably not a nice thing to require for making

Re: [Monotone-devel] Error handling via automate

2006-09-10 Thread Nathaniel Smith
On Sun, Sep 10, 2006 at 12:34:56PM +1000, Daniel Carosone wrote: Would an 'automate' locale/translation, with machine-friendly messages like this, be unreasonable? Aside from being insane, I think it isn't possible -- you can't just use arbitrary strings for locales, at least on some systems

Re: [Monotone-devel] Error handling via automate

2006-09-10 Thread Nathaniel Smith
On Sun, Sep 10, 2006 at 10:00:11AM +0200, Thomas Keller wrote: Nathaniel Smith schrieb: Another possibility in this particular case would be automate update simply require that the caller provide the target revision; then this error can't happen. Instead, the caller would go to get the target

Re: [Monotone-devel] Error handling via automate

2006-09-10 Thread Daniel Carosone
On Sun, Sep 10, 2006 at 02:45:28AM -0700, Nathaniel Smith wrote: On Sun, Sep 10, 2006 at 12:34:56PM +1000, Daniel Carosone wrote: Would an 'automate' locale/translation, with machine-friendly messages like this, be unreasonable? Aside from being insane, I think it isn't possible Oh well,

Re: [Monotone-devel] Error handling via automate

2006-09-10 Thread Timothy Brownawell
On Mon, 2006-09-11 at 13:08 +1000, Daniel Carosone wrote: On Sun, Sep 10, 2006 at 02:45:28AM -0700, Nathaniel Smith wrote: On Sun, Sep 10, 2006 at 12:34:56PM +1000, Daniel Carosone wrote: Would an 'automate' locale/translation, with machine-friendly messages like this, be unreasonable?

Re: [Monotone-devel] Error handling via automate

2006-09-09 Thread Nathaniel Smith
On Fri, Sep 08, 2006 at 04:27:30PM +0200, Thomas Keller wrote: I'm currently struggle how to accomplish proper error handling for errors which are spit out by monotone's automate commands (and specifically mtn automate stdio). [...] Indeed -- thanks for the good summary of the issues. Error

Re: [Monotone-devel] Error handling via automate

2006-09-09 Thread Daniel Carosone
On Sat, Sep 09, 2006 at 06:57:51PM -0700, Nathaniel Smith wrote: Another possibility in this particular case would be automate update simply require that the caller provide the target revision; then this error can't happen. Instead, the caller would go to get the target for the update,

Re: [Monotone-devel] Error handling via automate

2006-09-09 Thread Timothy Brownawell
On Sun, 2006-09-10 at 12:34 +1000, Daniel Carosone wrote: Possibly the structure of SMTP/HTTP/FTP/... style response codes are a useful precedent? Or possibly there should be a small set of errors defined on a per-command basis? Would an 'automate' locale/translation, with

[Monotone-devel] Error handling via automate

2006-09-08 Thread Thomas Keller
Hi all! I'm currently struggle how to accomplish proper error handling for errors which are spit out by monotone's automate commands (and specifically mtn automate stdio). Currently stdio only allows to distinguish three states: 0: no error 1: a syntax error popped up 2: any other error popped