Finding out what errorcodes means



  • Hello! We're running this code:

    except Exception as err:
        print("Error... ", err)
        f = open('/flash/log.txt', 'a+')
        print("writing to log file...")
        f.write(str(err) + "\n")
        print("close file...")
        f.close()
    

    And we're getting these error codes written to log.txt:
    128
    -1
    We don't know what they mean, is there any way of finding out?



  • @jhn

    try to use

    sys.print_exception(err, f)
    

    instead of

    f.write(str(err))
    

    This will show you the stack trace as well and the error text


Log in to reply
 

Pycom on Twitter