You should already be getting a stack trace and the exact source code that causes the issue. If you're asking about badly transformed code (as in, the output is incorrect), then you'd have to do some digging like disabling plugins 1 by 1 until you track down the offender.