* [pve-devel] [PATCH common] rest handler: map path to methods: avoid returning misleading 'internal error'
@ 2026-01-19 10:15 Fiona Ebner
2026-01-20 15:12 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread
* [pve-devel] applied: [PATCH common] rest handler: map path to methods: avoid returning misleading 'internal error'
2026-01-19 10:15 [pve-devel] [PATCH common] rest handler: map path to methods: avoid returning misleading 'internal error' Fiona Ebner
@ 2026-01-20 15:12 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2026-01-20 15:12 UTC (permalink / raw)
To: pve-devel, Fiona Ebner
On Mon, 19 Jan 2026 11:15:41 +0100, Fiona Ebner wrote:
> 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
>
> [...]
Applied, thanks!
[1/1] rest handler: map path to methods: avoid returning misleading 'internal error'
commit: a93a3d396d5e32e7daa7f502c5f8065126c85cc2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-20 15:13 UTC | newest]
Thread overview: 2+ messages (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
2026-01-20 15:12 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox