Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
0954-observer-What-to-do-with-bad-options.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0954-observer-What-to-do-with-bad-options.patch of Package erlang
From 90ba37e1086a0299ac7acb759c0af220a84d3c2a Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Thu, 31 Mar 2022 18:52:58 +0200 Subject: [PATCH 4/5] [observer] What to do with "bad" options Include "bad" options in the list, but not with a "value" (since we did not get any). Instead with something that will explain "something": A string; either "-", "Not Supported" or "error: ..." We can see what is missing and why (its better then nothing). Also, this is approx like what is done for socket. OTP-18012 --- lib/runtime_tools/src/observer_backend.erl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/runtime_tools/src/observer_backend.erl b/lib/runtime_tools/src/observer_backend.erl index d4245d172c..5af565394c 100644 --- a/lib/runtime_tools/src/observer_backend.erl +++ b/lib/runtime_tools/src/observer_backend.erl @@ -240,14 +240,19 @@ get_sock_opts(Port, [Opt|Opts], Acc) -> {ok, [Res]} -> get_sock_opts(Port, Opts, [Res|Acc]); {ok, []} -> % No value? - get_sock_opts(Port, Opts, Acc); + Res = {Opt, "-"}, + get_sock_opts(Port, Opts, [Res|Acc]); {error, einval} -> - get_sock_opts(Port, Opts, Acc); + Res = {Opt, "Not Supported"}, + get_sock_opts(Port, Opts, [Res|Acc]); %% If the option is "invalid", the reason would be 'einval', - %% so this error must be something else => fail - {error, _} = ERROR -> - ERROR + %% so this error must be something else. + %% But if the option just vanish, we don't know what is + %% going on. So, do something similar to socket (see below). + {error, Reason} -> + Res = {Opt, lists:flatten(io_lib:format("error:~p", [Reason]))}, + get_sock_opts(Port, Opts, [Res|Acc]) end. -- 2.34.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor