def create_exception(error_codec):
if error_codec.error_code in ERROR_CODE_TO_ERROR:<EOL><INDENT>return ERROR_CODE_TO_ERROR[error_codec.error_code](error_codec.message)<EOL><DEDENT>stack_trace = "<STR_LIT:\n>".join(<EOL>["<STR_LIT>" % (x.declaring_class, x.method_name, x.file_name, x.line_number) for x in<EOL>error_codec.stack_trace])<EOL>message = "<STR_LIT>" % (error_codec.class_name,<EOL>error_codec.message,<EOL>stack_trace)<EOL>return HazelcastError(message)<EOL>
Creates an exception with given error codec.

:param error_codec: (Error Codec), error codec which includes the class name, message and exception trace.
:return: (Exception), the created exception.