The argument str is displayed when the program stops.
If str is not specified, no message is displayed.