Can you add file, line and type to the raised error. You can use `rescue_metadata` above, but maybe it doesn't work in this case.

I'm not sure if we should say that the order_by expression is invalid rather than the distinct expression. Wdyt?