Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#5322 closed Bug (worksforme)

[transmission-remote] exit code if server connection failed

Reported by: quite Owned by: jordan
Priority: Normal Milestone: None Set
Component: Utils Version: 2.77
Severity: Normal Keywords:
Cc:

Description

Could transmission-remote exit with a non-zero code if it fails to connect to server? (and perhaps if it otherwise fails to process requested command)

Change History (6)

comment:1 Changed 7 years ago by mike.dld

  • Type changed from Enhancement to Bug

comment:2 Changed 7 years ago by jordan

What's the use case for this?

comment:3 follow-up: Changed 7 years ago by quite

If it has already been considered as a bug, why question the use case? ;)

Programs commonly return an error code if a program fails (in the un*x world non-zero is an error). This is very useful when scripting, which I think is quite common to do with transmission-remote.

I don't remember exactly why I submitted this, because it now seems it does return an error code (and zero if all went fine).

comment:4 Changed 7 years ago by livings124

  • Resolution set to worksforme
  • Status changed from new to closed

No idea why this was changed to bug.

comment:5 in reply to: ↑ 3 Changed 7 years ago by jordan

Replying to quite:

If it has already been considered as a bug, why question the use case? ;)

I was asking both you and the person who switched it from Enhancement to Bug...

comment:6 Changed 7 years ago by mike.dld

I had the same argument. If program fails to do what it's been asked to, it usually reports this to user. Inability to execute RPC request is a failure which should be reported. (Note, however, that successfully executed RPC request which returned correctly formatted error object from the other side is not a failure.) Now, failures are usually reported by means of exit code, and also a message(s) written to standard error stream. Since message(s) may not be (and generally need not be, and most of the time are not) formatted in a way suitable for parsing, I personally consider exit code as a better means of telling caller that something is wrong.

Note: See TracTickets for help on using tickets.