Add graceful error message for invalid json files

This commit is contained in:
rubenwardy 2022-06-25 15:36:46 +01:00
parent ec8dcf5960
commit 56298ed57f

@ -13,6 +13,7 @@
#
# 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/>.
from json import JSONDecodeError
import gitdb
import json
@ -138,6 +139,8 @@ def postReleaseCheckUpdate(self, release: PackageRelease, path):
do_edit_package(package.author, package, False, False, data, "Post release hook")
except LogicError as e:
raise TaskError(e.message)
except JSONDecodeError as e:
raise TaskError("Whilst reading .cdb.json: " + str(e))
except IOError:
pass