An example for a "domain error":
?- catch(length(L,-1),C,true). C = error(domain_error(not_less_than_zero, -1), context(length/2, _6042)).
So, to throw this, one would write:
?- catch(domain_error(not_less_than_zero, -1),C,true). % throw directly inside catch C = error(domain_error(not_less_than_zero, -1), _15024). % we got the correct exception term
There is no way to set error/2's second argument, the "context". It seems to be set when the exception is generated by built-in functions only.
And note this
?- atom_length(a,-1). false.
So, just causing the predicate to fail is another possibility.