Allow passing a custom error function for screens