Skip to content

Conversation

@brbzull0
Copy link
Contributor

While working on a different pr I found out that some error weren't displayed by traffic_ctl as it was before the jsonrpc change, this change fixes this and also changes the output style for a "better" quick read, more like it was before jsonrpc.

Now this prints the main error and in a second level the more specifics. There could be more than one second level error.

$ traffic_ctl config set invalid.record val
Server Error found:
[9] Error during execution
- [2000] Record not found.

@brbzull0 brbzull0 added the JSONRPC JSONRPC 2.0 related work. label May 16, 2022
@brbzull0 brbzull0 added this to the 10.0.0 milestone May 16, 2022
@brbzull0 brbzull0 requested a review from bryancall as a code owner May 16, 2022 14:49
@brbzull0 brbzull0 self-assigned this May 16, 2022
@bryancall bryancall requested review from SolidWallOfCode and removed request for bryancall May 16, 2022 23:04
Copy link
Member

@SolidWallOfCode SolidWallOfCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to pretty printing? Is that always the case now?

for (; iter != std::end(err.data); ++iter) {
os << "---\n";
my_print(*iter);
os << "- [" << iter->first << "] " << iter->second << '\n';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the interleaved --- is no longer being printed, this could just be a simple for (auto it: err.data) ... loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. Missed that, thanks a lot, fixed now.

…he formatting type. This also changes

the output style for a better quick read.
@brbzull0 brbzull0 force-pushed the traffic_ctl_print_general_error_by_default branch from 8e35b3d to 9d7ed37 Compare May 17, 2022 10:57
@brbzull0
Copy link
Contributor Author

What happened to pretty printing? Is that always the case now?

No, it still work for cases that it's implemented and you request it, but the pretty printing is more for message ouitput(jsonrpc.result) and not for the error. This is for general error, so it will be printed anyway regardless your --format choice.

@brbzull0 brbzull0 merged commit d1313ea into apache:10-Dev May 18, 2022
JosiahWI pushed a commit to JosiahWI/trafficserver that referenced this pull request Jul 19, 2023
…he formatting type. (apache#8852) (apache#682)

- This also changesthe output style for a better quick read.

(cherry picked from commit d1313ea)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JSONRPC JSONRPC 2.0 related work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants