 
      
      serial::get_error()Get the error string
serial::get_error()There are no parameters.
string — Returns the error string
import serial
 
arduino = serial("/dev/ttyACM0")
 
if !arduino.is_open()
    exit(arduino.get_error())
endif
 
arduino.write("Hello")
arduino.close()