Feature Requests item #2813606, was opened at 2009-06-28 20:00
Message generated for change (Comment added) made by mr-meltdown
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482471&aid=2813606&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
Priority: 5
Private: No
Submitted By: Stefan de Konink (skinkie)
Assigned to: Nobody/Anonymous (nobody)
>Summary: MAPI: Error message for access denied

Initial Comment:
The error value for an access denied (for example when a user is not granted to 
access a table) is set. But the error message is not. My suggestion is to set 
the in mapilib message, my strlen crashed, so I expect it was returning a null 
value. I have fixed my code by adding a null check.

----------------------------------------------------------------------

>Comment By: Fabian (mr-meltdown)
Date: 2009-12-01 10:00

Message:
we'll stick with plain old Mapi, so this feature request boils down to a
RTFC

----------------------------------------------------------------------

Comment By: Fabian (mr-meltdown)
Date: 2009-07-13 10:41

Message:
this is more of a feature request that gijs is going to tackle

----------------------------------------------------------------------

Comment By: Fabian (mr-meltdown)
Date: 2009-06-28 21:42

Message:
I agree, it's almost impossible to pick the right function for the error at
hand.

----------------------------------------------------------------------

Comment By: Stefan de Konink (skinkie)
Date: 2009-06-28 21:38

Message:
> Can you shed some light on how you would describe the difference between
"error value" and "error message"?

Ofcourse; as the documentation on
<http://monetdb.cwi.nl/projects/monetdb/SQL/Documentation/Mapi-Function-Reference.html>
explains the user:

MapiMsg mapi_error(Mapi mid)
Return the last error code or 0 if there is no error. 

> In particular what the "error value" for an "access denied" is.

While:
char *mapi_error_str(Mapi mid)
Return a pointer to the last error message. 

or

char *mapi_result_error(MapiHdl hdl)
Return a pointer to the last error message from the server. 


So what a user of the mapilib expects here is that MapiMsg is a value upon
error or 0 if there is no error. Now if I should use mapi_error_str or
mapi_result_error, or as suggested
<http://monetdb.cwi.nl/XQuery/Documentation/Library-Synopsis.html> (notice
the typo) map_explain_result() is open to me.

----------------------------------------------------------------------

Comment By: Fabian (mr-meltdown)
Date: 2009-06-28 21:29

Message:
/* Render error reply
*/
cherokee_dwriter_dict_open (&hdl->writer);
add_cstr_int (&hdl->writer, "SUCCESS", false);
add_cstr_int (&hdl->writer, "MONETDB_ERRNO",
mapi_error(dbh));

tmp = mapi_result_error(resHdl);
if (tmp)
add_cstr_str (&hdl->writer,
"MONETDB_ERROR", tmp, strlen(tmp));

Can you shed some light on how you would describe the difference between
"error value" and "error message"?  In particular what the "error value"
for an "access denied" is.

----------------------------------------------------------------------

Comment By: Stefan de Konink (skinkie)
Date: 2009-06-28 21:22

Message:
> can you give us (me) the slightest clue what you're doing

I'm trying to do a query on a table I have not been granted access to. And
trying to render the error message notifying my failure to do so. 


> what happens

The error message is not set, since strlen crashed on the result value I
expect it returned null.


> and what you expect?

My suggestion is to set the in mapilib message.


If the words cannot give you a clue I have the compiled C code here...

                        /* Render error reply
                         */
                        cherokee_dwriter_dict_open (&hdl->writer);
                        add_cstr_int (&hdl->writer, "SUCCESS", false);
                        add_cstr_int (&hdl->writer, "MONETDB_ERRNO",
mapi_error(dbh));

                        tmp = mapi_result_error(resHdl);
                        if (tmp)
                                add_cstr_str (&hdl->writer,
"MONETDB_ERROR", tmp, strlen(tmp));


----------------------------------------------------------------------

Comment By: Fabian (mr-meltdown)
Date: 2009-06-28 21:09

Message:
can you give us (me) the slightest clue what you're doing, what happens and
what you expect?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482471&aid=2813606&group_id=56967

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to