adding error handling doc

just copy pasted what alex wrote in his PR,
We need to make it more generic though..