How to return Error message that output by SerialException? In here i try to open port in port that already open. I want to get error that occurs. In the case SerialException will return Access is denied
could not open port 'COM38': PermissionError(13, 'Access is denied.', None, 5)
import serial
from serial import SerialException
def open:
try:
serial.Serial('COM38', 9600)
return True
except SerialException:
#How to return error message that serial exception occurs?
return Raise
print(open())