Subject: [Jmap] First cut at error codes registry

From: "Chris Newman" <[email-masked]>
Date: Mon, 16 Jul 2018 19:13:26 -0400

Here's my initial pull request for an error code registry for JMAP core:

  https://github.com/jmapio/jmap/pull/246

Issues I encountered:

1. The naming convention for HTTP-level errors (all lower case) and 
method-level errors (camelCase) is different. It looks weird with a 
combined registry. I prefer a combined registry to avoid error naming 
overlap based on scope (and to simplify the text). Should we make the 
method-level errors camel case, or is the difference deliberate?

2. Each error is used in one or more object types (e.g. JMAP Error 
object, JMAP SetError object) and may or may not be method-specific. 
Should I try to add a column to the registry to distinguish where an 
error is used, or should I keep the registry simpler? If you prefer 
another column, suggested text would be appreciated.

Feel free to comment here or on the PR.

		Thanks for feedback,
		- Chris

---

From: Ken Murchison <[email-masked]>
Date: Mon, 16 Jul 2018 21:16:26 -0400

> method-level errors camel case, or is the difference deliberate?

I vote for making the HTTP-level errors camelCase as well.

> another column, suggested text would be appreciated.

I  have no string opinion on this issue.

-- 
Ken Murchison
Cyrus Development Team
FastMail US LLC

---

From: Neil Jenkins <[email-masked]>
Date: Mon, 23 Jul 2018 06:27:23 -0400

Thanks Chris. I've merged this, although we can still make changes of course.

> method-level errors (camelCase) is different.

I've changed these to be camelCase so everything is consistent.

> another column, suggested text would be appreciated.

I'm not sure about this. If the purpose is primarily to avoid name collisions between different specs, then there's no need to document this. If you're a client author looking up all the error codes you might need to handle, you'd still need to read the referenced section of the RFCs to see if it was relevant, but it would let you skip some that definitely didn't apply. So, I don't think it's necessary, but it could be mildly useful.

The column would need to be something like "Error context" with value for each row any combination of "Request, Method, Set" (the three different levels that errors are returned at).

Neil.