couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anthony Ananich (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (COUCHDB-1659) Empty error message when validation function conflicts with Update Handler
Date Tue, 29 Jan 2013 22:07:12 GMT

     [ https://issues.apache.org/jira/browse/COUCHDB-1659?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Anthony Ananich updated COUCHDB-1659:
-------------------------------------

    Description: 
I have a design doc (attached to this isssue) with update handler and validation function.
When I submit HTML form to the update handler, I've got the following error:

{
    error: "case_clause",
    reason: "{[]}"
}

The issue is that this error has no information about what the actual reason is.

Update Handler:

function(doc, req) {
	if (parseInt(req.form.key)>10) {
		return [null, "not updated"];;
	} else {
		if (doc==null) {
			doc = req.form;
		} else {
			doc.val = req.query.val;
		}
		return [doc, "updated"];
	}
}

Validate Function:

function(newDoc, oldDoc, userCtx, secObj) {
	if (parseInt(doc.key)>5) {
		throw ({forbidden: "key is too big"});
	}
}


  was:
I have a design doc (attached to this isssue) with update handler and validation function.
When I submit HTML form to the update handler, Ive got the following error:

{
    error: "case_clause",
    reason: "{[]}"
}

The issue is that this error has no information about what the actual reason is.

    
> Empty error message when validation function conflicts with Update Handler
> --------------------------------------------------------------------------
>
>                 Key: COUCHDB-1659
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1659
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core, JavaScript View Server
>            Reporter: Anthony Ananich
>         Attachments: app.txt, log.txt
>
>
> I have a design doc (attached to this isssue) with update handler and validation function.
When I submit HTML form to the update handler, I've got the following error:
> {
>     error: "case_clause",
>     reason: "{[]}"
> }
> The issue is that this error has no information about what the actual reason is.
> Update Handler:
> function(doc, req) {
> 	if (parseInt(req.form.key)>10) {
> 		return [null, "not updated"];;
> 	} else {
> 		if (doc==null) {
> 			doc = req.form;
> 		} else {
> 			doc.val = req.query.val;
> 		}
> 		return [doc, "updated"];
> 	}
> }
> Validate Function:
> function(newDoc, oldDoc, userCtx, secObj) {
> 	if (parseInt(doc.key)>5) {
> 		throw ({forbidden: "key is too big"});
> 	}
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message