Evas/cserve2: Improve error messages a bit

This commit is contained in:
Jean-Philippe Andre 2014-01-13 17:15:20 +09:00
parent a0dc5c16ac
commit 1d99c82381
3 changed files with 19 additions and 11 deletions

View File

@ -1591,17 +1591,15 @@ _image_entry_new(Client *client, int rid,
ref = eina_hash_find(client->files.referencing, &client_file_id); ref = eina_hash_find(client->files.referencing, &client_file_id);
if (!ref) if (!ref)
{ {
ERR("Couldn't find file id for client image id: %d", ERR("Couldn't find file id for client image id: %d", client_file_id);
client_file_id); cserve2_client_error_send(client, rid, CSERVE2_INVALID_CACHE);
cserve2_client_error_send(client, rid,
CSERVE2_INVALID_CACHE);
return NULL; return NULL;
} }
fd = _file_data_find(ref->entry->id); fd = _file_data_find(ref->entry->id);
if (!fd || fd->invalid) if (!fd || fd->invalid)
{ {
cserve2_client_error_send(client, rid, ERR("Can't find file data %d (rid %d)", ref->entry->id, rid);
CSERVE2_FILE_CHANGED); cserve2_client_error_send(client, rid, CSERVE2_FILE_CHANGED);
return NULL; return NULL;
} }
@ -2922,8 +2920,8 @@ cserve2_cache_image_load(Client *client, unsigned int client_image_id, unsigned
ref = eina_hash_find(client->images.referencing, &client_image_id); ref = eina_hash_find(client->images.referencing, &client_image_id);
if (!ref) if (!ref)
{ {
ERR("Can't load: client %d has no image id %d", ERR("Can't load: client %d has no image id %d (rid %d)",
client->id, client_image_id); client->id, client_image_id, rid);
cserve2_client_error_send(client, rid, CSERVE2_NOT_LOADED); cserve2_client_error_send(client, rid, CSERVE2_NOT_LOADED);
return; return;
} }
@ -2932,6 +2930,7 @@ cserve2_cache_image_load(Client *client, unsigned int client_image_id, unsigned
idata = _image_data_find(ENTRYID(ientry)); idata = _image_data_find(ENTRYID(ientry));
if (!idata) if (!idata)
{ {
ERR("Can't load image %d for rid %d: data not found", ENTRYID(ientry), rid);
cserve2_client_error_send(client, rid, CSERVE2_INVALID_CACHE); cserve2_client_error_send(client, rid, CSERVE2_INVALID_CACHE);
return; return;
} }
@ -2939,6 +2938,8 @@ cserve2_cache_image_load(Client *client, unsigned int client_image_id, unsigned
fd = _file_data_find(idata->file_id); fd = _file_data_find(idata->file_id);
if (!fd || fd->invalid) if (!fd || fd->invalid)
{ {
ERR("Can't load image %d for rid %d%s", idata->file_id, rid,
fd->invalid ? ": invalid" : "");
cserve2_client_error_send(client, rid, CSERVE2_FILE_CHANGED); cserve2_client_error_send(client, rid, CSERVE2_FILE_CHANGED);
return; return;
} }

View File

@ -144,8 +144,8 @@ _cserve2_client_open(Client *client)
end = key + strlen(key) + 1; end = key + strlen(key) + 1;
INF("Received OPEN command: RID=%d", msg->base.rid); INF("Received OPEN command: RID=%d", msg->base.rid);
INF("File_ID: %d, path=\"%s\", key=\"%s\", has_load_opts=%d", INF("File_ID: %d, Image_ID: %d, path=\"%s\", key=\"%s\", has_load_opts=%d",
msg->file_id, path, key, (int) msg->has_load_opts); msg->file_id, msg->image_id, path, key, (int) msg->has_load_opts);
if (!key[0]) key = NULL; if (!key[0]) key = NULL;
if (msg->has_load_opts) if (msg->has_load_opts)

View File

@ -604,7 +604,14 @@ _server_dispatch(Eina_Bool *failed)
rid = msg->rid; rid = msg->rid;
if (!found) if (!found)
WRN("Got unexpected response %d for request %d", msg->type, rid); {
if (msg->type == CSERVE2_ERROR)
{
Msg_Error *error = (Msg_Error *) msg;
ERR("Cserve2 sent error %d for rid %d", error->error, rid);
}
else WRN("Got unexpected response %d for request %d", msg->type, rid);
}
free(msg); free(msg);
return rid; return rid;