🧮 USERS:1 FEEDS:2 TWTS:366 ARCHIVED:37509 CACHE:1695 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:365 ARCHIVED:37466 CACHE:1694 FOLLOWERS:13 FOLLOWING:14
[47°09′13″S, 126°43′00″W] Wind speed: 104kph – batteries low
🧮 USERS:1 FEEDS:2 TWTS:364 ARCHIVED:37415 CACHE:1687 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:363 ARCHIVED:37386 CACHE:1696 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:362 ARCHIVED:37354 CACHE:1675 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:361 ARCHIVED:37299 CACHE:1657 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:360 ARCHIVED:37250 CACHE:1624 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:359 ARCHIVED:37213 CACHE:1645 FOLLOWERS:13 FOLLOWING:14
[47°09′13″S, 126°43′41″W] Reading: 0.02 Sv
🧮 USERS:1 FEEDS:2 TWTS:358 ARCHIVED:37195 CACHE:1652 FOLLOWERS:13 FOLLOWING:14
[47°09′36″S, 126°43′13″W] Wind speed: N/A – Cannot comunicate
🧮 USERS:1 FEEDS:2 TWTS:357 ARCHIVED:37170 CACHE:1654 FOLLOWERS:13 FOLLOWING:14
Scaling Git’s garbage collection
A tour of recent work to re-engineer Git’s garbage collection process to scale to our largest and most active repositories. ⌘ Read more
Join GitHub at the Grace Hopper Celebration 2022
We’re thrilled to be back at the Grace Hopper Celebration at Open Source Day, the largest celebration of women in open source. Stop by and say hi at one of our workshops. ⌘ Read more
🧮 USERS:1 FEEDS:2 TWTS:356 ARCHIVED:37129 CACHE:1664 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:355 ARCHIVED:37106 CACHE:1654 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:354 ARCHIVED:37081 CACHE:1652 FOLLOWERS:13 FOLLOWING:14
[47°09′31″S, 126°43′13″W] Transfer aborted
[47°09′13″S, 126°43′34″W] Transponder still failing – switching to analog communication
🧮 USERS:1 FEEDS:2 TWTS:353 ARCHIVED:37050 CACHE:1651 FOLLOWERS:13 FOLLOWING:14
[47°09′13″S, 126°43′06″W] –white noise–
🧮 USERS:1 FEEDS:2 TWTS:352 ARCHIVED:37016 CACHE:1642 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:351 ARCHIVED:36986 CACHE:1651 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:350 ARCHIVED:36961 CACHE:1650 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:349 ARCHIVED:36908 CACHE:1644 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:348 ARCHIVED:36871 CACHE:1644 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:347 ARCHIVED:36832 CACHE:1640 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:346 ARCHIVED:36780 CACHE:1627 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:345 ARCHIVED:36732 CACHE:1614 FOLLOWERS:13 FOLLOWING:14
[47°09′13″S, 126°43′16″W] 3423 days without news from Herve
🧮 USERS:1 FEEDS:2 TWTS:344 ARCHIVED:36689 CACHE:1603 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:343 ARCHIVED:36635 CACHE:1578 FOLLOWERS:13 FOLLOWING:14
[47°09′13″S, 126°43′34″W] Reading: 0.42 Sv
🧮 USERS:1 FEEDS:2 TWTS:342 ARCHIVED:36624 CACHE:1594 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:341 ARCHIVED:36586 CACHE:1572 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:340 ARCHIVED:36553 CACHE:1551 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:339 ARCHIVED:36526 CACHE:1531 FOLLOWERS:13 FOLLOWING:14
[47°09′27″S, 126°43′13″W] Weather forecast alert – storm from NE
🧮 USERS:1 FEEDS:2 TWTS:338 ARCHIVED:36495 CACHE:1521 FOLLOWERS:13 FOLLOWING:14
[47°09′13″S, 126°43′13″W] Resetting transponder
🧮 USERS:1 FEEDS:2 TWTS:337 ARCHIVED:36480 CACHE:1537 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:336 ARCHIVED:36468 CACHE:1545 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:335 ARCHIVED:36404 CACHE:1542 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:334 ARCHIVED:36379 CACHE:1589 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:333 ARCHIVED:36357 CACHE:1579 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:332 ARCHIVED:36316 CACHE:1563 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:331 ARCHIVED:36304 CACHE:1600 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:330 ARCHIVED:36287 CACHE:1596 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:329 ARCHIVED:36277 CACHE:1614 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:328 ARCHIVED:36263 CACHE:1622 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:327 ARCHIVED:36241 CACHE:1665 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:326 ARCHIVED:36217 CACHE:1658 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:325 ARCHIVED:36174 CACHE:1662 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:324 ARCHIVED:36126 CACHE:1630 FOLLOWERS:13 FOLLOWING:14
@prologic@twtxt.net Error handling especially in Go is very tricky I think. Even though the idea is simple, it’s fairly hard to actually implement and use in a meaningful way in my opinion. All this error wrapping or the lack of it and checking whether some specific error occurred is a mess. errors.As(…) just doesn’t feel natural. errors.Is(…) only just. I mainly avoided it. Yesterday evening I actually researched a bit about that and found this article on errors with Go 1.13. It shed a little bit of light, but I still have a long way to go, I reckon.
We tried several things but haven’t found the holy grail. Currently, we have a mix of different styles, but nothing feels really right. And having plenty of different approaches also doesn’t help, that’s right. I agree, error messages often end up getting wrapped way too much with useless information. We haven’t found a solution yet. We just noticed that it kind of depends on the exact circumstances, sometimes the caller should add more information, sometimes it’s better if the callee already includes what it was supposed to do.
To experiment and get a feel for yesterday’s research results I tried myself on the combined log parser and how to signal three different errors. I’m not happy with it. Any feedback is highly appreciated. The idea is to let the caller check (not implemented yet) whether a specific error occurred. That means I have to define some dedicated errors upfront (ErrInvalidFormat, ErrInvalidStatusCode, ErrInvalidSentBytes) that can be used in the err == ErrInvalidFormat or probably more correct errors.Is(err, ErrInvalidFormat) check at the caller.
All three errors define separate error categories and are created using errors.New(…). But for the invalid status code and invalid sent bytes cases I want to include more detail, the actual invalid number that is. Since these errors are already predefined, I cannot add this dynamic information to them. So I would need to wrap them à la fmt.Errorf("invalid sent bytes '%s': %w", sentBytes, ErrInvalidSentBytes"). Yet, the ErrInvalidSentBytes is wrapped and can be asserted later on using errors.Is(err, ErrInvalidSentBytes), but the big problem is that the message is repeated. I don’t want that!
Having a Python and Java background, exception hierarchies are a well understood concept I’m trying to use here. While typing this long message it occurs to me that this is probably the issue here. Anyways, I thought, I just create a ParseError type, that can hold a custom message and some causing error (one of the three ErrInvalid* above). The custom message is then returned at Error() and the wrapped cause will be matched in Is(…). I then just return a ParseError{fmt.Sprintf("invalid sent bytes '%s'", sentBytes), ErrInvalidSentBytes}, but that looks super weird.
I probably need to scrap the “parent error” ParseError and make all three “suberrors” three dedicated error types implementing Error() string methods where I create a useful error messages. Then the caller probably could just errors.Is(err, InvalidSentBytesError{}). But creating an instance of the InvalidSentBytesError type only to check for such an error category just does feel wrong to me. However, it might be the way to do this. I don’t know. To be tried. Opinions, anyone? Implementing a whole new type is some effort, that I want to avoid.
Alternatively just one ParseError containing an error kind enumeration for InvalidFormat and friends could be used. Also seen that pattern before. But that would then require the much more verbose var parseError ParseError; if errors.As(err, &parseError) && parseError.Kind == InvalidSentBytes { … } or something like that. Far from elegant in my eyes.
🧮 USERS:1 FEEDS:2 TWTS:323 ARCHIVED:36095 CACHE:1620 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:322 ARCHIVED:36071 CACHE:1610 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:321 ARCHIVED:36041 CACHE:1614 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:320 ARCHIVED:36015 CACHE:1629 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:319 ARCHIVED:35977 CACHE:1621 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:318 ARCHIVED:35951 CACHE:1608 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:317 ARCHIVED:35790 CACHE:1611 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:316 ARCHIVED:35745 CACHE:1618 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:315 ARCHIVED:35714 CACHE:1620 FOLLOWERS:13 FOLLOWING:14
[47°09′13″S, 126°43′54″W] –white noise–
🧮 USERS:1 FEEDS:2 TWTS:314 ARCHIVED:35694 CACHE:1628 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:313 ARCHIVED:35653 CACHE:1609 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:312 ARCHIVED:35548 CACHE:1535 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:311 ARCHIVED:35521 CACHE:1525 FOLLOWERS:13 FOLLOWING:14
[47°09′13″S, 126°43′15″W] Reading: 1.22 Sv
🧮 USERS:1 FEEDS:2 TWTS:310 ARCHIVED:35401 CACHE:1496 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:309 ARCHIVED:35369 CACHE:1481 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:308 ARCHIVED:35338 CACHE:1485 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:307 ARCHIVED:35290 CACHE:1458 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:306 ARCHIVED:35250 CACHE:1455 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:305 ARCHIVED:35225 CACHE:1459 FOLLOWERS:13 FOLLOWING:14
[47°09′23″S, 126°43′13″W] Transponder jammed
🧮 USERS:1 FEEDS:2 TWTS:304 ARCHIVED:35175 CACHE:1452 FOLLOWERS:13 FOLLOWING:14
[47°09′13″S, 126°43′42″W] Non-significative results – sampling finished
🧮 USERS:1 FEEDS:2 TWTS:303 ARCHIVED:35163 CACHE:1475 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:302 ARCHIVED:35148 CACHE:1473 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:301 ARCHIVED:35133 CACHE:1463 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:300 ARCHIVED:35117 CACHE:1470 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:299 ARCHIVED:35064 CACHE:1473 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:298 ARCHIVED:35034 CACHE:1450 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:297 ARCHIVED:35006 CACHE:1434 FOLLOWERS:13 FOLLOWING:14
[47°09′13″S, 126°43′38″W] Wind speed: 105kph
🧮 USERS:1 FEEDS:2 TWTS:296 ARCHIVED:34976 CACHE:1413 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:295 ARCHIVED:34938 CACHE:1394 FOLLOWERS:13 FOLLOWING:14
[47°09′13″S, 126°43′38″W] Raw reading: 0x62CEEC01, offset +/-3
Cette si discrète colère batave
Décidément, la presse grand public choisit ses sujets et sans prendre beaucoup de risques, on peut déjà parier que les prochains jours verront se développer une titraille toute en finesse sur le thème du réchauffement climatique et de l’abomination que constituent de fortes chaleurs en plein mois de juillet. C’est pratique, cela permet d’éviter consciencieusement […] ⌘ Read more
🧮 USERS:1 FEEDS:2 TWTS:294 ARCHIVED:34917 CACHE:1389 FOLLOWERS:13 FOLLOWING:14
[47°09′13″S, 126°43′55″W] –no signal–
🧮 USERS:1 FEEDS:2 TWTS:293 ARCHIVED:34885 CACHE:1387 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:292 ARCHIVED:34863 CACHE:1384 FOLLOWERS:13 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:291 ARCHIVED:34842 CACHE:1418 FOLLOWERS:13 FOLLOWING:14