~gt-launchpad/ladon/test

« back to all changes in this revision

Viewing changes to frameworks/python/src/ladon/types/ladontype.py

  • Committer: Tamás Gulácsi
  • Date: 2011-08-22 05:00:57 UTC
  • mfrom: (40.1.1 ladon)
  • Revision ID: gt-dev-ladon@gthomas.eu-20110822050057-iinzb0przsmqj66b
merged upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
186
186
                                
187
187
                                # Need some kind of check for optional in type definition class
188
188
                                if attr_type in TypeManager.global_type_dict:
189
 
                                        res_dict[attr_name] = attr_val.__dict__(tc,response_attachments)
 
189
                                        try:
 
190
                                                res_dict[attr_name] = attr_val.__dict__(tc,response_attachments)
 
191
                                        except Exception as e:
 
192
                                                raise AttributeConversionException(
 
193
                                                        self,
 
194
                                                        'An exception was raised while processing LadonType attribute "%s"\nDetails:%s' % (attr_name,str(e)),
 
195
                                                        attr_name)
190
196
                                elif attr_type == attachment:
191
197
                                        if not type(attr_val) == attachment:
192
198
                                                raise AttachmentExpected(
195
201
                                                        attr_name)
196
202
                                        res_dict[attr_name] = response_attachments.add_attachment(attr_val)
197
203
                                else:
198
 
                                        res_dict[attr_name] = tc.to_unicode_string(attr_val,attr_type)
 
204
                                        try:
 
205
                                                res_dict[attr_name] = tc.to_unicode_string(attr_val,attr_type)
 
206
                                        except Exception as e:
 
207
                                                raise AttributeConversionException(
 
208
                                                        self,
 
209
                                                        'An exception was raised while processing attribute "%s"\nDetails:%s' % (attr_name,str(e)),
 
210
                                                        attr_name)
199
211
                return res_dict
200
212
 
201
213
from ladon.types.typemanager import TypeManager