Repository navigation
Commit 4a4b935
committed
[CHORE] Hold the status helper to its own precondition, and take the log level with the handler
Three small ones.
IsAcknowledgedStatus() is noexcept and reached straight for get(), leaving the type check
to whoever called it. The one caller does check, so nothing is wrong today, but the two
ways a later one could get it wrong are not symmetrical: a string throws, and out of a
noexcept function that is std::terminate rather than a wrong answer, while a float does
not throw at all, it truncates, so 200.5 would have answered for 200. The check is now
where the assumption is.
The asynchronous cases saved and restored the log handler but not the log level. The
level is process wide, another case in the same binary can lower it, and a failure the
runtime filtered out looks exactly like one the parser never reported, so they would have
stopped discriminating without saying so. This is not hypothetical in this file: the
debug case added earlier passed for that reason until the level went in beside the
handler.
The header now says what it does not do. A repeated key is folded before the document
reaches this, so a body carrying both "errors": true and "errors": false arrives as
whichever one the parser kept, and nothing here can tell the other was sent. Deciding an
outcome from the documented fields is what this is for; standing up to a responder that
is trying to be believed is not.
Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>1 parent c8a6715 commit 4a4b935
2 files changed
Lines changed: 33 additions & 1 deletion
File tree
- exporters/elasticsearch
- include/opentelemetry/exporters/elasticsearch/detail
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
51 | 58 | | |
52 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
53 | 65 | | |
54 | 66 | | |
55 | 67 | | |
| |||
64 | 76 | | |
65 | 77 | | |
66 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
67 | 84 | | |
68 | 85 | | |
69 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
671 | 679 | | |
672 | 680 | | |
673 | 681 | | |
674 | 682 | | |
675 | 683 | | |
676 | 684 | | |
677 | 685 | | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
678 | 690 | | |
679 | 691 | | |
680 | 692 | | |
| |||
697 | 709 | | |
698 | 710 | | |
699 | 711 | | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
700 | 715 | | |
701 | 716 | | |
702 | 717 | | |
| |||
0 commit comments