From 97768420029c0b9afce2026cf678f304f29e5c70 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 22 2015 08:49:22 +0000 Subject: Create a dictionary of all the errors the API can return --- diff --git a/pagure/api/__init__.py b/pagure/api/__init__.py index 817759b..8b31498 100644 --- a/pagure/api/__init__.py +++ b/pagure/api/__init__.py @@ -22,6 +22,15 @@ import pagure import pagure.lib +API_ERROR_CODE = { + 0: 'Variable message describing the issue', + 1: 'Project not found', + 2: 'No issue tracker found for this project', + 3: 'An error occured at the database level and prevent the action from ' + 'reaching completion', +} + + def api_login_required(f, acls=None): @functools.wraps(f) def decorated_function(*args, **kwargs):