Add logging to study processing

Tiny change but useful for debugging.
I'm still a bit confused on this errors...
If this errors are shown to the user, you should not put this the user information. If they're not shown to the user, which is the "nice" page that the user will see that says "Forbidden"?