Add graceful error message for invalid json files

master
rubenwardy 2022-06-25 15:36:46 +01:00
parent ec8dcf5960
commit 56298ed57f
1 changed files with 3 additions and 0 deletions

View File

@ -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