* [pve-devel] [PATCH common] rest handler: map path to methods: avoid returning misleading 'internal error'
@ 2026-01-19 10:15 Fiona Ebner
0 siblings, 0 replies; only message in thread
From: Fiona Ebner @ 2026-01-19 10:15 UTC (permalink / raw)
To: pve-devel
When a path pointing to below a leaf endpoint is provided, for example
'/access/acl/foobar', then when reaching the leaf endpoint, there is
neither a regex nor subfolders to continue the lookup. This is fully
expected, but currently an 'internal error' message will be returned
and the only caller will log it to syslog. Returning undef instead
avoids the misleading error log while otherwise preserving the same
behavior as before. That is, failing the request with a clear error:
501 Method 'GET /access/acl/foobar' not implemented
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/RESTHandler.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/PVE/RESTHandler.pm b/src/PVE/RESTHandler.pm
index cc82fe8..0dfb54e 100644
--- a/src/PVE/RESTHandler.pm
+++ b/src/PVE/RESTHandler.pm
@@ -383,8 +383,8 @@ sub map_path_to_methods {
} elsif ($path_lookup->{folders}) {
$path_lookup = $path_lookup->{folders}->{$comp};
$$pathmatchref .= '/' . $comp if defined($pathmatchref);
- } else {
- die "internal error";
+ } else { # leaf endpoint
+ return undef;
}
return undef if !$path_lookup;
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-19 10:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-19 10:15 [pve-devel] [PATCH common] rest handler: map path to methods: avoid returning misleading 'internal error' Fiona Ebner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.