git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: RFC: error codes on exit

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
May 21, 2021, 01:33 UTC
Message-ID
<YKcOA7iVstB7LtZH@camp.crustytoothpaste.net>
In-Reply-To
<795fd316-2bb5-e382-b104-85d1aaa09a1c@jeffhostetler.com>
On 2021-05-20 at 15:09:44, Jeff Hostetler wrote:
Show 9 quoted lines
> For the error event that `error()` and `die()` and friends generate,
> I emit both the fully formatted error message and the format string.
> 
> The latter, if used as a dictionary key, would let you group like
> events from different processes without worrying about the filename
> or blob id or remote name or etc. in any one particular instance.
> 
> Would that be sufficient as an error classification and something
> that you can key off of in your post-processing ?

I don't think that's going to be sufficient. Many calls to die() contain a translated string. I am a native Anglophone and work in a company where English is the sole language of communication, but I have my computer configured in French, and I have had it configured in Spanish as well.

It's totally possible that one of my colleagues who has a non-English native language might be using a different language as well, so it would be difficult to reliably map the format string into a fixed error case in a typical corporate setting, since many languages might be in use.

> Granted the same format message might be used in multiple places in
> the source, but I also provide the source filename and line number.

The source filename and line number would be more helpful, but inconveniently, people frequently change the code of Git, so the line numbers aren't always stable over time. So I think an error code would be helpful nevertheless.

-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US
Previous: Jeff HostetlerNext: brian m. carlson
Message 24 of 26 in “RFC: error codes on exit”
  1. Jonathan NiederMay 19, 2021
  2. Felipe ContrerasMay 20, 2021
  3. Alex HenrieMay 21, 2021
  4. H. Peter AnvinMay 21, 2021
  5. Bagas SanjayaMay 22, 2021
  6. Junio C HamanoMay 22, 2021
  7. H. Peter AnvinMay 22, 2021
  8. Felipe ContrerasMay 22, 2021
  9. H. Peter AnvinMay 22, 2021
  10. Felipe ContrerasMay 22, 2021
  11. H. Peter AnvinMay 22, 2021
  12. Philip OakleyMay 22, 2021
  13. Felipe ContrerasMay 22, 2021
  14. Alex HenrieMay 25, 2021
  15. Felipe ContrerasMay 25, 2021
  16. Junio C HamanoMay 20, 2021
  17. Felipe ContrerasMay 20, 2021
  18. Jonathan NiederMay 20, 2021
  19. Junio C HamanoMay 20, 2021
  20. Jeff KingMay 20, 2021
  21. Jonathan NiederMay 20, 2021
  22. Jeff KingMay 21, 2021
  23. Jeff HostetlerMay 20, 2021
  24. brian m. carlsonMay 21, 2021
  25. brian m. carlsonMay 21, 2021
  26. Ævar Arnfjörð BjarmasonMay 26, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.