Fix formatting of base-only pairs in exception messages.
This commit is contained in:
parent
c4afbb5ec0
commit
cdd78f0445
1 changed files with 2 additions and 2 deletions
|
@ -9,7 +9,7 @@ class InvalidPair(SourceError, ValueError):
|
||||||
self.base = base
|
self.base = base
|
||||||
self.quote = quote
|
self.quote = quote
|
||||||
self.source = source
|
self.source = source
|
||||||
pair = "/".join([base, quote])
|
pair = "/".join([s for s in [base, quote] if s])
|
||||||
insert = message + " " if message else ""
|
insert = message + " " if message else ""
|
||||||
|
|
||||||
full_message = (
|
full_message = (
|
||||||
|
@ -25,7 +25,7 @@ class InvalidType(SourceError, ValueError):
|
||||||
|
|
||||||
def __init__(self, type, base, quote, source):
|
def __init__(self, type, base, quote, source):
|
||||||
self.type = type
|
self.type = type
|
||||||
self.pair = "/".join([base, quote])
|
self.pair = "/".join([s for s in [base, quote] if s])
|
||||||
message = (
|
message = (
|
||||||
f"Invalid price type '{type}' for pair '{self.pair}'. "
|
f"Invalid price type '{type}' for pair '{self.pair}'. "
|
||||||
f"Run 'pricehist source {source.id()} "
|
f"Run 'pricehist source {source.id()} "
|
||||||
|
|
Loading…
Add table
Reference in a new issue