Added exception handling to separate out GCode errors