<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def shutdown(self):
 """ Shuts down connection to the device safely. :raise cam.CanError: is closing the connection did not work """

        status = self.can.close(self.handle)

        if status != CANAL_ERROR_SUCCESS:
            raise CanError("could not shut down bus: status == {}".format(status))