Rudimentary exception handling for C