Why are you storing error? Nothing is done with it.