1 essay on this topic.
Pasting the error back works until it doesn't. A real debugging method: reproduce, minimise, hypothesise, test, plus git bisect and stack traces.