Re: [PATCH 1/3] local-metadata: added a new local source




On Thu, 27 Jan 2011 11:25:07 +0100, "Juan A." Suárez Romero <jasuarez igalia com> wrote:
On Thu, 2011-01-27 at 08:05 +0000, Iago Toral wrote:
(...)
Maybe we should emit an error for these cases too. Not sure, really. In
these cases, I think adding a GRL_CORE_ERROR_RESOLVE_UNSUPPORTED and
GRL_CORE_ERROR_RESOLVE_REQ_FAILED would be worth.


I don't think we need to be that specific with the error code, we have GRL_CORE_ERROR_RESOLVE_FAILED and I think that is good enough. The error message can give the details.

On whether we should provide errors when preconditions are broken, usually we, at least, use g_return_if_(val)_fail so a critical is raised, but in no case we just ignore the problem as we are doing here. There is a problem and we should let the user/developer know about it, not hide it completely.

Then again, it is not just about the precondition, in this patch even if we have the data (the URI) it can fail because it is not a proper uri or is malformed (it checks that it starts with "file").

As I said in my answer to Guillaume, in case we are in doubt I think we should raise an error: we have nothing to lose with that and it is not complicated to add, the other option, which is to hide the error, is always going to be the most problematic choice.

Iago


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]