Commit Graph

14 Commits

Author SHA1 Message Date
tison 866e85600d
docs: update development doc (#3700) 2021-05-22 11:47:33 +08:00
ShuNing 5f3188873f
*: update import path (#2772)
* *: update import path

Signed-off-by: nolouch <nolouch@gmail.com>
2020-08-17 14:59:10 +08:00
ShuNing bbe0c497ba
*: change API document's update method (#2337)
Signed-off-by: nolouch <nolouch@gmail.com>
2020-04-14 12:06:10 +08:00
pingcap-github-bot af99bf8a09
Use tools.go instead of retool (#2196) 2020-03-06 00:14:17 +08:00
混沌DM 7a3ae12be3
pd-web: remove (#2121) 2020-02-12 20:47:49 +08:00
混沌DM 4336d595e1 *: fix web UI build failure (#2047) 2019-12-24 22:42:41 +08:00
disksing 0c51b800c0
scripts, docs: update api document (#1346) 2018-11-27 16:27:42 +08:00
Greg Weber 744c3a69c9 integrate error codes with pkg/errors to provide error tracing (#1200)
* use pingcap/errcode
2018-09-30 14:10:19 +08:00
Ryan Leung b5992e356f *: fix invalid links (#1240) 2018-09-10 15:20:00 +08:00
Greg Weber 8fc28dd7ff move tool installs to a hack script (#1177)
This move unecessary tooling tasks out of the Makefile
and matches the setup in the tidb repo
2018-08-07 10:37:09 +08:00
Greg Weber 986931100c retool: install automatically and document (#1168) 2018-08-01 14:46:26 +08:00
Greg Weber 0af8ba062c
error codes: add hierarchy (#1156)
error codes: add hierarchy

Hierarchy is useful for documentation/classification purposes.
The hierarchy can also be traversed to find find meta data on ancestors.
This is now used in the HTTP Code implementation to inherit HTTP codes.

Note that Previously HTTP codes were specified on the go error type, which
doesn't make sense. Now HTTP codes are attached to an errcode.Code
value via metadata.

Previously I had already created error codes strings with a dot separation
hiearchy. However, that was informal. Now that relationship is validated
and modeled in code. The API still involves giving a dot separated hierachy.
This requires some simple trivial parsing/validation in the implementation
but made for a nicer API than specifying a struct with a parent link.

Some inspiration here was taken from the upspin error codes which are
classified by Kind. When I started adding kinds, I realized I just
wanted to represent them as Codes, which naturally led to hierarchy.
Kind classification can be though of as having many
error hierarchies with a depth of two and a high branching factor.
In our implementation the top level of the hierarchy can be used like a kind, but
we can also create as much or little depth in the tree as we would like.
https://commandcenter.blogspot.com/2017/12/error-handling-in-upspin.htm

* simpler representation for metadata

* allow just the child component of the code

* errcode: change CodeStr to a method

This makes it possible to change the storage format.
In particular redundant versus relying on parent traversal

* errcode: don't store the parent code on the child

Its not supported now, but this would would make it possible
to define children first and then define an ancestor.
It also reduces redundant memory usage a little.
2018-07-30 07:41:15 -07:00
disksing 48b343980d
api, document: add api.raml (#1105) 2018-07-27 19:23:58 +08:00
Greg Weber 8e72f3bcbe docs: add development.md to help new contributors (#1141) 2018-07-06 16:15:55 +08:00