A commenter to an answer I recently posted said:
Please don't ignore errors in "example" code... You know some fool will blindly cut-n-paste it and... later make some other SO answerer's life difficult.
I'm torn on the subject. On the one hand I see the commenter's point (fools will do foolish things and it can clutter our exchanges with poor quality questions); however, code that demonstrates best practices (proper error handling, resource cleanup, etc) can often drown the gist of the idea in details that are not specific to the question/answer.
Should code samples explicitly handle errors and cleanup resources or is it ok to omit those (admittedly important parts) for the sake of brevity and clarity?
//snip
or a<!-- yadda yadda -->
just to indicate I'm highlighting certain parts of what would be a complete example./* TODO: handle err */
.