comparison idavoll/xmpp_error.py @ 13:226a97dd79ff

Added two errors
author Ralph Meijer <ralphm@ik.nu>
date Sat, 17 Jul 2004 22:02:40 +0000
parents 76efc9114469
children 53b1bea9289b
comparison
equal deleted inserted replaced
12:d45e921a5d2a 13:226a97dd79ff
2 2
3 conditions = { 3 conditions = {
4 'bad-request': {'code': '400', 'type': 'modify'}, 4 'bad-request': {'code': '400', 'type': 'modify'},
5 'not-authorized': {'code': '401', 'type': 'cancel'}, 5 'not-authorized': {'code': '401', 'type': 'cancel'},
6 'item-not-found': {'code': '404', 'type': 'cancel'}, 6 'item-not-found': {'code': '404', 'type': 'cancel'},
7 'internal-server-error': {'code': '500', 'type': 'wait'},
7 'feature-not-implemented': {'code': '501', 'type': 'cancel'}, 8 'feature-not-implemented': {'code': '501', 'type': 'cancel'},
9 'service-unavailable': {'code': '503', 'type': 'cancel'},
8 } 10 }
9 11
10 def error_from_iq(iq, condition, text = '', type = None): 12 def error_from_iq(iq, condition, text = '', type = None):
11 iq.swapAttributeValues("to", "from") 13 iq.swapAttributeValues("to", "from")
12 iq["type"] = 'error' 14 iq["type"] = 'error'