What is the proper way to handle errors from function calls?
From: atv (atv-nospam_at_xs4all.nl)
Date: 11/29/03
- Next message: SS: "total newbie question"
- Previous message: Richard Heathfield: "Re: [OT] Indian C programmers and "u""
- Next in thread: Richard Heathfield: "Re: What is the proper way to handle errors from function calls?"
- Reply: Richard Heathfield: "Re: What is the proper way to handle errors from function calls?"
- Reply: The Real OS/2 Guy: "Re: What is the proper way to handle errors from function calls?"
- Reply: Nilesh: "Re: What is the proper way to handle errors from function calls?"
- Reply: Gordon Burditt: "Re: What is the proper way to handle errors from function calls?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 29 Nov 2003 12:13:45 +0100
Whatis the proper way to handle errors from function calls?
For example, i normally have a main function, with calls to mine
or c functions. Should i check for errors in the functions called
themselves, or should i return a code to main and handle the error
there?
If i don't return them to main, except for the structure, what
use is the main function except for calling functions?
I hope you understand what i mean. It seems a bit silly to call a function
created by me, from main, then if a error occurs in that function, to
return the value to main and print a message there.
should i handle errors and print error messages in the called functions or
leave it up to the main() function?
What's the best way?
- Next message: SS: "total newbie question"
- Previous message: Richard Heathfield: "Re: [OT] Indian C programmers and "u""
- Next in thread: Richard Heathfield: "Re: What is the proper way to handle errors from function calls?"
- Reply: Richard Heathfield: "Re: What is the proper way to handle errors from function calls?"
- Reply: The Real OS/2 Guy: "Re: What is the proper way to handle errors from function calls?"
- Reply: Nilesh: "Re: What is the proper way to handle errors from function calls?"
- Reply: Gordon Burditt: "Re: What is the proper way to handle errors from function calls?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]