a new Error containing an E_CAL_CLIENT_ERROR of the given code. If the custom_msg
is NULL, then the error message is the one returned from
error_to_string for the code, otherwise the given message is used. Returned pointer should be freed with
g_error_free.