Labs/F1/Modularity/WebMod-API: Difference between revisions

Jump to navigation Jump to search
add "validation" as an error result
m (note about maybe it should be 'confirm')
(add "validation" as an error result)
 
Line 87: Line 87:


==== error result ====
==== error result ====
If an error occurs, it will be reported via the normal jschannel error callback (ie, with ''error'' and ''message'' parameters, where the content of ''message'' will depend on the value of ''error''.  The following error values are supported:
If an error occurs, it will be reported via the normal jschannel error callback (ie, with ''error'' and ''message'' parameters, where the content of ''message'' will depend on the value of ''error''.  All strings which will be displayed to the user should be localized.  The following error values are supported:


;authentication: Indicates the message failed due to an authentication problem (eg, the cookie expired).  Authentication will be re-performed and the user will be given the opportunity of retrying the error.  ''message'' will be null.
;authentication: Indicates the message failed due to an authentication problem (eg, the cookie expired).  Authentication will be re-performed and the user will be given the opportunity of retrying the error.  ''message'' will be null.
;validation: Indicates validation of the data failed for some reason.  ''message'' will be an object with properties ''name'' (the name of the field in the send data which failed validation) and ''reason'' (the reason the field is invalid).  The F1 UI will display the error and focus the appropriate field so the user can fix it and retry.


;http_error: Indicates a HTTP error occurred sending the item.  ''message'' will be the http error code.  This would be an appropriate error if a back-end server returned a 500 error (eg, twitter was down), but is '''not''' appropriate for a 401 error - the service should translate a 401 to an ''authentication'' error if re-authentication is necessary.
;http_error: Indicates a HTTP error occurred sending the item.  ''message'' will be the http error code.  This would be an appropriate error if a back-end server returned a 500 error (eg, twitter was down), but is '''not''' appropriate for a 401 error - the service should translate a 401 to an ''authentication'' error if re-authentication is necessary.
Confirmed users
99

edits

Navigation menu