exit-code

SpecRun returning exit code 120 with @ignore tests

大兔子大兔子 提交于 2019-12-22 14:59:37
问题 Running SpecRun from command line as part of a Continuous Integration setup, and recently an ignored ( @ignore ) test generated an exit code of 120 when SpecRun completed. Currently, we break the build on any exit code not equal to 0 (universal success indicator!). What does exit code 120 mean exactly? Is it simply "A test was ignored"? or does it imply more? What other values are returned? Sample build output below. We collect all exit codes (currently 1 SpecRun task, so only 1 exit code is

exiting functions in main

大兔子大兔子 提交于 2019-12-22 05:45:08
问题 I am relatively new to Stackoverflow and Java, but I have a little experience in C. I liked the very clean way of C exiting the programs after a malfunction with the 'exit()' function. I found a similar function System.exit() in Java, what differs from the C function and when should I use a 'System.exit()' best instead of a simple 'return' in Java like in a void main function? 回答1: System.exit() will terminate the jvm initilized for this program, where return; just returns the control from

How to exit a program with an exit code: C#

假装没事ソ 提交于 2019-12-22 04:18:11
问题 How to exit a program with an exit code in C#? In java it would be System.exit(int code); 回答1: Either: Declare your Main function as returning int , and return a value from it, or Call Environment.Exit(int) Returning a value from Main is a little nicer than exiting the process in the middle of a method, but this is presumably the same advice that applies to Java, C or C++. 来源: https://stackoverflow.com/questions/3529393/how-to-exit-a-program-with-an-exit-code-c-sharp

Does Android care about exit status code passed to System.exit(…)?

百般思念 提交于 2019-12-22 04:06:09
问题 If I kill an Android app with System.exit(...), does it matter what status code I pass? I couldn't find any documentation on whether Android just ignores it or whether certain ones lead to any error messages for example or have any other meaning. 回答1: This is the exit code returned by the process when it finishes; Android however does not care, but know that the error code should never be higher then 255. Here is a list of standard exit codes - some process may use their own codes. 0 Clean

why does my JScript (windows script host) exit with 0 on an uncaught exception?

喜你入骨 提交于 2019-12-21 05:48:18
问题 I have some JScript which does some stuff with an ODBC connection. An exception was thrown by the ODBC ActiveXObject object and not caught in my script. I expected that the script would exit with an non 0 value but it didn't. Anyone know why this is the case and how to get it to exit with a non 0 value on an uncaught exception? 回答1: The JScript engine can be thought of as a virtual machine. If the JScript engine itself or the script host were to have some form of catastrophic failure you

How to get status of “Invoke-Expression”, successful or failed?

扶醉桌前 提交于 2019-12-21 03:47:46
问题 Invoke-Expression will return all the text of the command being invoked. But how can I get the system return value of whether this command has been executed successfully or with a failure? In CMD I could use %errorlevel% to get external command execution state. What about PowerShell? 回答1: Normally you would use $? to inspect the status of the last statement executed: PS C:\> Write-Output 123 | Out-Null; $? True PS C:\> Non-ExistingCmdlet 123 | Out-Null; $? False However, this won't work with

What is the meaning of values from Java Process.exitValue()?

徘徊边缘 提交于 2019-12-20 14:42:57
问题 I am using Process via ProcessBuilder to run an executable made in C code. I am catching the Process.exitValue() to react on this exit values. I noticed not all the exit values are from the executable. For example, I get an exit value of 139 and nowhere in my C code I am returning an exit value of 139. I am trying to find an overview of exit values, but I cannot find this, and now I found out the exit value can be OS dependent. (I am using Ubuntu by the way). It seems the only exit value to

Detect file creation with watchdog

北城余情 提交于 2019-12-20 10:25:09
问题 I am trying to detect when a file with a given name is created in a directory. I am doing it thanks to watchdog. The creation is correctly detected but I don't know how to terminate the application properly once the detection is done. My piece of code is the following: #!/usr/bin/env python # -*- coding: utf-8 -*- import logging import sys import time from watchdog.events import FileSystemEventHandler from watchdog.observers import Observer logging.basicConfig(level=logging.ERROR) class

Will calling System.exit(0); from an object outside of main run garbage collection?

夙愿已清 提交于 2019-12-20 04:56:12
问题 I plan to use an object which is called by my main method to exit the entire program. The object has a method which just runs a System.exit(0). My question is, is this a safe thing to do? If I run System.exit(0) from another object, will garbage collection still clean out the entire program from memory, or will I have issues cleaning the calling class from memory? My thoughts are that either since the JVM will be terminated, the calling class will be garbage-collected, or that I might have

How to test the exit status from IPC::Run3

泪湿孤枕 提交于 2019-12-19 11:32:10
问题 I'm trying to test the Perl module IPC::Run3 but having difficulty in checking whether a command is failed or successful. I know that IPC::Run3 issues an exit code if something is wrong with its arguments, but what about if the arguments are ok but the command does not exist? How can I test the following example? Having a subroutine to call Run3 sub runRun3 { my $cmd = shift; my ($stdout, $stderr); run3($cmd, \undef, \$stdout, \$stderr); # if( $? == -1 ) { if (! $stdout and ! $stderr) { die