Prior to any output in **that function**, yes.  Errors don't tend to play nice and restrict themselves to happening before the **application** sends any output, though.  If there's an error in your view, for example, there's a good chance one of the two ```show_error()``` functions will be called after you've already sent some part of your output.  Granted, if you have errors in your views, you're doing something wrong somewhere, but that's true of errors *anywhere* in your code.