diff options
author | Lipu Fei <lipu.fei815@gmail.com> | 2018-05-01 12:56:34 +0300 |
---|---|---|
committer | Lipu Fei <lipu.fei815@gmail.com> | 2018-05-01 12:56:34 +0300 |
commit | 9a5fb47a6e5b63e4acea0e2f50620c65e6a4e66c (patch) | |
tree | 8668eb7b7c3041c772facfe5fa9a981e2038a5e4 /plugins/GCodeProfileReader | |
parent | cc207a3f9246a589d5db1be409b776730fbcd77c (diff) | |
parent | 0d8674eceb736290a5f980184e77adc097e47f13 (diff) |
Merge master into material marketplace
Diffstat (limited to 'plugins/GCodeProfileReader')
-rw-r--r-- | plugins/GCodeProfileReader/GCodeProfileReader.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/GCodeProfileReader/GCodeProfileReader.py b/plugins/GCodeProfileReader/GCodeProfileReader.py index f255950c36..4b50a600ba 100644 --- a/plugins/GCodeProfileReader/GCodeProfileReader.py +++ b/plugins/GCodeProfileReader/GCodeProfileReader.py @@ -1,9 +1,10 @@ -# Copyright (c) 2015 Ultimaker B.V. +# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import re #Regular expressions for parsing escape characters in the settings. import json +from UM.Settings.ContainerFormatError import ContainerFormatError from UM.Settings.InstanceContainer import InstanceContainer from UM.Logger import Logger from UM.i18n import i18nCatalog @@ -113,6 +114,9 @@ def readQualityProfileFromString(profile_string): profile = InstanceContainer("") try: profile.deserialize(profile_string) + except ContainerFormatError as e: + Logger.log("e", "Corrupt profile in this g-code file: %s", str(e)) + return None except Exception as e: # Not a valid g-code file. Logger.log("e", "Unable to serialise the profile: %s", str(e)) return None |