So, I’m trying to copy a container from one system to another. If I do an lxc copy remote:container container it results in a generic “object not found” message. If I do export/import I get a generic “not found”. However, in no case does it say what is not found, leaving me having no real idea what to do. Adding -v doesn’t actually make it any more verbose, and changes nothing.
How can I find out what is missing and thus what can be done about it?
Haha, yeah, we have a Github issue to work on our error messages, especially not found which we definitely should be qualifying with what wasn’t found…
We are working towards improving this, for example this recent PR improved the error message when networks are not found from the generic “Not found” to “Network not found”.
We can follow this pattern in our DB queries to convert a raw DB ErrNoSuchObject and ErrNoRows error into a contextually relevant api.StatusError;
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return api.StatusErrorf(http.StatusNotFound, "Network not found")
}
I’m sure it would be possible, it may be we wrap the error in the API handler rather than in the DB layer so we aren’t returning info from the DB layer in the error that was asked for by the API handler.