Change variables: script_exit_code to script_error_code and map the error codes to script exit codes.