gpio error handling