Skip to content

Commit 5c70b66

Browse files
committed
gtid failed parsing: raise with value
When a gtid value is incorrect raise the value that we attempted to parse
1 parent 7259ef4 commit 5c70b66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymysqlreplication/gtid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Gtid(object):
1010
def parse_interval(interval):
1111
m = re.search('^([0-9]+)(?:-([0-9]+))?$', interval)
1212
if not m:
13-
raise ValueError('GTID format is incorrect')
13+
raise ValueError('GTID format is incorrect: %r' % (interval, ))
1414
if not m.group(2):
1515
return (int(m.group(1)))
1616
else:
@@ -21,7 +21,7 @@ def parse_interval(interval):
2121
def parse(gtid):
2222
m = re.search('^([0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})((?::[0-9-]+)+)$', gtid)
2323
if not m:
24-
raise ValueError('GTID format is incorrect')
24+
raise ValueError('GTID format is incorrect: %r' % (gtid, ))
2525

2626
sid = m.group(1)
2727
intervals = m.group(2)

0 commit comments

Comments
 (0)