Skip to content

Commit 557ce4f

Browse files
committed
Improve error message when no device selected on post
Spent way too long debugging why a fresh install allowed "search" command to work, but not "copy". Turns out I had forgotten to run "config" first. The confusing part is that "search" seems to implicitly select a device while "copy" does not. Either way, using __get_uri() avoids some copy/paste URI generation and presents a better error message ("No device selected.") that would've been useful for initial debugging.
1 parent f396c67 commit 557ce4f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tablo/endpoint.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ def getCached(self, **kwargs):
9696
@request_handler
9797
def post(self, *args, **kwargs):
9898
return requests.post(
99-
'http://{0}/{1}'.format(
100-
self.device.address(), '/'.join(self.segments)
101-
),
99+
self.__get_uri(),
102100
headers={'User-Agent': USER_AGENT},
103101
data=json.dumps(args and args[0] or kwargs)
104102
)

0 commit comments

Comments
 (0)