asterixdb-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugenia Gabrielova <genia.likes.scie...@gmail.com>
Subject REST API error code question for Invalid Statements (API docs nitpick)
Date Mon, 08 Jun 2015 07:44:50 GMT
Hello! This is a docs/code matchup nitpick question.

*Question: *Reality or docs: which is correct error-code for Invalid
Statements submitted to AsterixDB REST API? Why aren't Algebricks and
Hyracks Exceptions documented in the REST API, though they have their own
error-codes?

*Version: *0.8.7 Master

*Proposed Solutions: *Add an error code for instances of AsterixException,
and/or update API docs to reflect actual behavior.

*Details: *Working on some test cases for errors for the JS SDK. According
to the REST API docs (https://asterixdb.ics.uci.edu/documentation/api.html),
a REST API call with an Invalid Statement should return error-code 1.

When I submit a query statement to the DDL endpoint, I observe error code
99.

*use dataverse test_company;*
*for $ds in dataset Metadata.Dataset return $ds;*
 [*99*,
  'Invalid statement: Non-DDL statement QUERY to the DDL API.
[AsterixException]' ]

*What I've tried so far: *I noticed in
*asterix-app/src/main/java/edu/uci/ics/asterix/result/ResultUtils.java* that
an Invalid Statement error-code 1 is not set, so the 99 code I am observing
makes sense. I also noticed that Algebricks and Hyracks exceptions are not
*210     public static void apiErrorHandler(PrintWriter out, Exception e) {*
*211         int errorCode = 99;*
*212         if (e instanceof ParseException) {*
*213             errorCode = 2;*
*214         } else if (e instanceof AlgebricksException) {*
*215             errorCode = 3;*
*216         } else if (e instanceof HyracksDataException) {*
*217             errorCode = 4;*
*218         }*

Thanks!
Eugenia

Mime
View raw message