My whole idea is that it returns 0 when succesfull and an @error code when it isn'succesfull and exits with an @error is it fails somewhere before the function finishes.