Centralizing MeshKit compatible errors

In one of the development meetings in early September, the question was raised whether MeshKit compatible common errors could be centralized rather than declaring them in each package separately.

From a subsequent Slack thread some concrete example (summarized):

  • For meshery adapter operations? This way we could give more elaborate messages to the user when an adapter operation fails…
  • Failed to read a file
  • Failed to attach a token
  • Failed to make a request
  • Statuscode is not 200
  • Failed to write a file

Detailed and concrete information is of course desirable to make troubleshooting easy.

From the thread in Slack I assume that this addresses centralizing within a repo/module (i.e. in internal/common) and not across repos/modules (i.e. all common errors in meshkit repo for instance) - is that correct?

@piyushsingariya curious for your thoughts…

Yup, centralizing some of the repetitive errors could be good, because many of them are just too standard and because we are declaring them each time for one package, is resulting in increased number of lines, repetitive code, and decreased code-coverage.

PS- I am sorry, I am responding to this too late.

1 Like