Retrieving the client_id on the custom error page

It appears that this issue is related to this post wherein those parameters/objects just aren’t present at that point as they have been removed from session.

So is there an alternative to identifying the application that this error occurred in?