mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-25 15:31:37 +01:00
Add graceful error message for invalid json files
This commit is contained in:
parent
ec8dcf5960
commit
56298ed57f
@ -13,6 +13,7 @@
|
|||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
from json import JSONDecodeError
|
||||||
|
|
||||||
import gitdb
|
import gitdb
|
||||||
import json
|
import json
|
||||||
@ -138,6 +139,8 @@ def postReleaseCheckUpdate(self, release: PackageRelease, path):
|
|||||||
do_edit_package(package.author, package, False, False, data, "Post release hook")
|
do_edit_package(package.author, package, False, False, data, "Post release hook")
|
||||||
except LogicError as e:
|
except LogicError as e:
|
||||||
raise TaskError(e.message)
|
raise TaskError(e.message)
|
||||||
|
except JSONDecodeError as e:
|
||||||
|
raise TaskError("Whilst reading .cdb.json: " + str(e))
|
||||||
except IOError:
|
except IOError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user