Custom HTTP error messages?

If the user attempts to submit an out of date form, I am trying to present
a nice message like "There is a newer version of the form 'Fluffy Animals'.
Please download it and try again." or "Il y a un version nouveau du fiche
...".

Currently the best I can get seems to be an HTTP status code and a reason
phrase (e.g. Unauthorized) if I'm lucky.

Am I doing something wrong?

Might there be some way to render an xml response body, instead of an empty
one, that contains a message to be displayed?

··· -- Tom Smyth Worker-Owner, Sassafras Tech Collective Specializing in innovative, usable tech for social change sassafrastech.com

How is the form submitted?

If via a tool (e.g., ODK Collect, ODK Briefcase), if the OpenRosa Version
header is supplied, then the response format is documented here:
https://bitbucket.org/javarosa/javarosa/wiki/FormSubmissionAPI

You could potentially put a useful message there and display that to the
user. I think we just pass the error text currently.

If via the web page with the upload submission link (on the Submission
Admin sub-tab), then the request is a simple HTTP Post, and we treat that
using the standard HTTP behaviors of returning an error status code.

Mitch

··· On Wed, Sep 18, 2013 at 4:03 PM, Thomas Smyth wrote:

If the user attempts to submit an out of date form, I am trying to present
a nice message like "There is a newer version of the form 'Fluffy Animals'.
Please download it and try again." or "Il y a un version nouveau du fiche
...".

Currently the best I can get seems to be an HTTP status code and a reason
phrase (e.g. Unauthorized) if I'm lucky.

Am I doing something wrong?

Might there be some way to render an xml response body, instead of an
empty one, that contains a message to be displayed?

--
Tom Smyth
Worker-Owner, Sassafras Tech Collective
Specializing in innovative, usable tech for social change
sassafrastech.com

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

The tool is ODK Collect submitting to ELMO. Are you saying that if I return
something like:

Form Received! You've submitted 5 forms today

from ELMO that the message will be displayed in ODK Collect? I looked at
the code and didn't see where that was being done but perhaps I missed it...

··· On 23 September 2013 13:41, Mitch Sundt wrote:

How is the form submitted?

If via a tool (e.g., ODK Collect, ODK Briefcase), if the OpenRosa Version
header is supplied, then the response format is documented here:
https://bitbucket.org/javarosa/javarosa/wiki/FormSubmissionAPI

You could potentially put a useful message there and display that to the
user. I think we just pass the error text currently.

If via the web page with the upload submission link (on the Submission
Admin sub-tab), then the request is a simple HTTP Post, and we treat that
using the standard HTTP behaviors of returning an error status code.

Mitch

On Wed, Sep 18, 2013 at 4:03 PM, Thomas Smyth tom@sassafrastech.comwrote:

If the user attempts to submit an out of date form, I am trying to
present a nice message like "There is a newer version of the form 'Fluffy
Animals'. Please download it and try again." or "Il y a un version nouveau
du fiche ...".

Currently the best I can get seems to be an HTTP status code and a reason
phrase (e.g. Unauthorized) if I'm lucky.

Am I doing something wrong?

Might there be some way to render an xml response body, instead of an
empty one, that contains a message to be displayed?

--
Tom Smyth
Worker-Owner, Sassafras Tech Collective
Specializing in innovative, usable tech for social change
sassafrastech.com

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Tom Smyth
Worker-Owner, Sassafras Tech Collective
Specializing in innovative, usable tech for social change
sassafrastech.com

Hmm. Looks like this is missing from ODK Collect.

If you code it and test it, we could add this messaging to ODK Collect.

For Google AppEngine implementations, this is not useful because the error
page (entity body) is static, rather than dynamic, so we can never
synthesize a custom message.

Mitch

··· On Mon, Sep 23, 2013 at 12:12 PM, Thomas Smyth wrote:

The tool is ODK Collect submitting to ELMO. Are you saying that if I
return something like:

Form Received! You've submitted 5 forms today

from ELMO that the message will be displayed in ODK Collect? I looked at
the code and didn't see where that was being done but perhaps I missed it...

On 23 September 2013 13:41, Mitch Sundt mitchellsundt@gmail.com wrote:

How is the form submitted?

If via a tool (e.g., ODK Collect, ODK Briefcase), if the OpenRosa Version
header is supplied, then the response format is documented here:
https://bitbucket.org/javarosa/javarosa/wiki/FormSubmissionAPI

You could potentially put a useful message there and display that to the
user. I think we just pass the error text currently.

If via the web page with the upload submission link (on the Submission
Admin sub-tab), then the request is a simple HTTP Post, and we treat that
using the standard HTTP behaviors of returning an error status code.

Mitch

On Wed, Sep 18, 2013 at 4:03 PM, Thomas Smyth tom@sassafrastech.comwrote:

If the user attempts to submit an out of date form, I am trying to
present a nice message like "There is a newer version of the form 'Fluffy
Animals'. Please download it and try again." or "Il y a un version nouveau
du fiche ...".

Currently the best I can get seems to be an HTTP status code and a
reason phrase (e.g. Unauthorized) if I'm lucky.

Am I doing something wrong?

Might there be some way to render an xml response body, instead of an
empty one, that contains a message to be displayed?

--
Tom Smyth
Worker-Owner, Sassafras Tech Collective
Specializing in innovative, usable tech for social change
sassafrastech.com

--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Tom Smyth
Worker-Owner, Sassafras Tech Collective
Specializing in innovative, usable tech for social change
sassafrastech.com

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Ok thanks for confirming this!

··· On 23 September 2013 16:01, Mitch Sundt wrote:

Hmm. Looks like this is missing from ODK Collect.

If you code it and test it, we could add this messaging to ODK Collect.

For Google AppEngine implementations, this is not useful because the error
page (entity body) is static, rather than dynamic, so we can never
synthesize a custom message.

Mitch

On Mon, Sep 23, 2013 at 12:12 PM, Thomas Smyth tom@sassafrastech.comwrote:

The tool is ODK Collect submitting to ELMO. Are you saying that if I
return something like:

Form Received! You've submitted 5 forms today

from ELMO that the message will be displayed in ODK Collect? I looked at
the code and didn't see where that was being done but perhaps I missed it...

On 23 September 2013 13:41, Mitch Sundt mitchellsundt@gmail.com wrote:

How is the form submitted?

If via a tool (e.g., ODK Collect, ODK Briefcase), if the OpenRosa
Version header is supplied, then the response format is documented here:
https://bitbucket.org/javarosa/javarosa/wiki/FormSubmissionAPI

You could potentially put a useful message there and display that to the
user. I think we just pass the error text currently.

If via the web page with the upload submission link (on the Submission
Admin sub-tab), then the request is a simple HTTP Post, and we treat that
using the standard HTTP behaviors of returning an error status code.

Mitch

On Wed, Sep 18, 2013 at 4:03 PM, Thomas Smyth tom@sassafrastech.comwrote:

If the user attempts to submit an out of date form, I am trying to
present a nice message like "There is a newer version of the form 'Fluffy
Animals'. Please download it and try again." or "Il y a un version nouveau
du fiche ...".

Currently the best I can get seems to be an HTTP status code and a
reason phrase (e.g. Unauthorized) if I'm lucky.

Am I doing something wrong?

Might there be some way to render an xml response body, instead of an
empty one, that contains a message to be displayed?

--
Tom Smyth
Worker-Owner, Sassafras Tech Collective
Specializing in innovative, usable tech for social change
sassafrastech.com

--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Tom Smyth
Worker-Owner, Sassafras Tech Collective
Specializing in innovative, usable tech for social change
sassafrastech.com

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Tom Smyth
Worker-Owner, Sassafras Tech Collective
Specializing in innovative, usable tech for social change
sassafrastech.com