Added more information in error when LaunchPeerExecution method doesn't match caller's

This commit is contained in:
pb 2025-03-11 16:48:05 +01:00
parent 70cb5aec9f
commit 92965c6af2

View File

@ -75,7 +75,7 @@ func (p *PeerCache) LaunchPeerExecution(peerID string, dataID string,
fmt.Println("Launching peer execution on", caller.URLS, dt, method)
methods := caller.URLS[dt] // Get the methods url of the data type
if m, ok := methods[method]; !ok || m == "" {
return nil, errors.New("no path found")
return nil, errors.New("Requested method " + method.String() + " not declared in HTTPCaller")
}
path := methods[method] // Get the path corresponding to the action we want to execute
path = strings.ReplaceAll(path, ":id", dataID) // Replace the id in the path in case of a DELETE / UPDATE method (it's a standard naming in OC)