rc after error message

Report any Hollywood bugs here
Post Reply
polluks
Posts: 11
Joined: Mon Jan 24, 2022 11:18 pm
Contact:

rc after error message

Post by polluks »

Hi!
After "Cannot open codesets.library" you get rc=0 :roll:

Regards,
Stefan
Hollywood 9.1:
MorphOS 3.19
macOS 26.2
User avatar
airsoftsoftwair
Posts: 5856
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: rc after error message

Post by airsoftsoftwair »

Hollywood currently never sets any DOS error code. What do you need this for?
polluks
Posts: 11
Joined: Mon Jan 24, 2022 11:18 pm
Contact:

Re: rc after error message

Post by polluks »

For example if you are using a Hollywood app in a shell script...
Hollywood 9.1:
MorphOS 3.19
macOS 26.2
plouf
Posts: 672
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: rc after error message

Post by plouf »

Error() , is any help to what are you trying to do ?
Christos
polluks
Posts: 11
Joined: Mon Jan 24, 2022 11:18 pm
Contact:

Re: rc after error message

Post by polluks »

plouf wrote: Sun Oct 22, 2023 4:06 pm Error() , is any help to what are you trying to do ?
I see, but this workaround is laborious.
A shell or installer script should use
IF ERROR ...
Hollywood 9.1:
MorphOS 3.19
macOS 26.2
User avatar
airsoftsoftwair
Posts: 5856
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: rc after error message

Post by airsoftsoftwair »

polluks wrote: Sun Oct 22, 2023 3:49 pm For example if you are using a Hollywood app in a shell script...
Hmm, yeah, might make sense to add this but then of course the question is if it should also return those codes in case of script runtime errors. Need to make up my mind about this.
User avatar
airsoftsoftwair
Posts: 5856
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: rc after error message

Post by airsoftsoftwair »

Code: Select all

- Change: Hollywood sets the return code to 20 now whenever an error has occurred; this allows you to
  react on it when embedding Hollywood in batch scripts
User avatar
airsoftsoftwair
Posts: 5856
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: rc after error message

Post by airsoftsoftwair »

Changed this a little, the error code is now user-configurable:

Code: Select all

- New: Added the ERRORCODE console argument/tooltype; this argument allows you to set an error code that
  Hollywood should return in case an error occurs; this allows you to react on certain error codes when
  embedding Hollywood in batch scripts; note that the code set via ERRORCODE will only be returned in case
  a Hollywood error occurs; your script can also return error codes using the End() function
Post Reply