The function can never return anything but 0. The error variable inside it is not used for anything but return.