How do I throw an error within $w.onReady?

Super, thanks Ahmad. Yes that is what I did in the end - redirecting to a non existing page and letting the server handle the 404 redirect. I was hoping there was something a little more explicit on the client side … along the lines of ‘throw 404 exception’ but this solution is fine.