{"action":"created","issue":{"url":"https://api.github.com/repos/cargomedia/CM/issues/1837","labels_url":"https://api.github.com/repos/cargomedia/CM/issues/1837/labels{/name}","comments_url":"https://api.github.com/repos/cargomedia/CM/issues/1837/comments","events_url":"https://api.github.com/repos/cargomedia/CM/issues/1837/events","html_url":"https://github.com/cargomedia/CM/pull/1837","id":94570351,"number":1837,"title":"Promise behaviour of Form.submit()","user":{"login":"njam","id":360800,"avatar_url":"https://avatars.githubusercontent.com/u/360800?v=3","gravatar_id":"","url":"https://api.github.com/users/njam","html_url":"https://github.com/njam","followers_url":"https://api.github.com/users/njam/followers","following_url":"https://api.github.com/users/njam/following{/other_user}","gists_url":"https://api.github.com/users/njam/gists{/gist_id}","starred_url":"https://api.github.com/users/njam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njam/subscriptions","organizations_url":"https://api.github.com/users/njam/orgs","repos_url":"https://api.github.com/users/njam/repos","events_url":"https://api.github.com/users/njam/events{/privacy}","received_events_url":"https://api.github.com/users/njam/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cargomedia/CM/labels/selfmade","name":"selfmade","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"vogdb","id":372386,"avatar_url":"https://avatars.githubusercontent.com/u/372386?v=3","gravatar_id":"","url":"https://api.github.com/users/vogdb","html_url":"https://github.com/vogdb","followers_url":"https://api.github.com/users/vogdb/followers","following_url":"https://api.github.com/users/vogdb/following{/other_user}","gists_url":"https://api.github.com/users/vogdb/gists{/gist_id}","starred_url":"https://api.github.com/users/vogdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vogdb/subscriptions","organizations_url":"https://api.github.com/users/vogdb/orgs","repos_url":"https://api.github.com/users/vogdb/repos","events_url":"https://api.github.com/users/vogdb/events{/privacy}","received_events_url":"https://api.github.com/users/vogdb/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2015-07-12T14:43:50Z","updated_at":"2015-07-14T11:49:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cargomedia/CM/pulls/1837","html_url":"https://github.com/cargomedia/CM/pull/1837","diff_url":"https://github.com/cargomedia/CM/pull/1837.diff","patch_url":"https://github.com/cargomedia/CM/pull/1837.patch"},"body":"`CM_Form_Abstract.submit()` returns a Promise which behaves like this:\r\n- Client side validation errors: resolve\r\n- Server side validation errors: resolve\r\n- Successful submit: resolve\r\n\r\nWhy do we not reject on validation errors?\r\nI have a usage where I submit a form directly and use the returned Promise to control the further control flow. In that case I would expect that the promise only resolves on successful submit. \r\nwdyt?"},"comment":{"url":"https://api.github.com/repos/cargomedia/CM/issues/comments/121213637","html_url":"https://github.com/cargomedia/CM/pull/1837#issuecomment-121213637","issue_url":"https://api.github.com/repos/cargomedia/CM/issues/1837","id":121213637,"user":{"login":"vogdb","id":372386,"avatar_url":"https://avatars.githubusercontent.com/u/372386?v=3","gravatar_id":"","url":"https://api.github.com/users/vogdb","html_url":"https://github.com/vogdb","followers_url":"https://api.github.com/users/vogdb/followers","following_url":"https://api.github.com/users/vogdb/following{/other_user}","gists_url":"https://api.github.com/users/vogdb/gists{/gist_id}","starred_url":"https://api.github.com/users/vogdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vogdb/subscriptions","organizations_url":"https://api.github.com/users/vogdb/orgs","repos_url":"https://api.github.com/users/vogdb/repos","events_url":"https://api.github.com/users/vogdb/events{/privacy}","received_events_url":"https://api.github.com/users/vogdb/received_events","type":"User","site_admin":false},"created_at":"2015-07-14T11:49:53Z","updated_at":"2015-07-14T11:49:53Z","body":"> - CM_Exception_FormFieldValidation: Should the constructor then accept an `errorList` array argument?\r\n\r\nNot needed. CM_Exception_FormFieldValidation <= CM_Exception <= Error. So the `errorList->toString()` will be called to set the message of Error. For now it's fine."}}