def unwrap_json(self, type, json_data):
<EOL>try:<EOL><INDENT>data = json.loads(json_data)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise RedmineError(json_data)<EOL><DEDENT>try:<EOL><INDENT>data = data[type]<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>return data<EOL>
Decodes a json string, and unwraps any 'type' it finds within.