I have temporarily just used the  ECMAScript Error type. As this is a general problem for many specifications it might be better to wait and see where the discussion on error handling in W3C APIs goes.