Skip to content

Commit 5804621

Browse files
ferozededenhill
authored andcommitted
Issue-674 fix indenting in SerializerError (@ferozed, confluentinc#675)
1 parent 4b54a11 commit 5804621

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

confluent_kafka/avro/serializer/__init__.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ class SerializerError(Exception):
2222
def __init__(self, message):
2323
self.message = message
2424

25-
def __repr__(self):
26-
return '{klass}(error={error})'.format(
27-
klass=self.__class__.__name__,
28-
error=self.message
29-
)
30-
31-
def __str__(self):
32-
return self.message
25+
def __repr__(self):
26+
return '{klass}(error={error})'.format(
27+
klass=self.__class__.__name__,
28+
error=self.message
29+
)
30+
31+
def __str__(self):
32+
return self.message
3333

3434

3535
class KeySerializerError(SerializerError):

tests/test_SerializerError.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
import unittest
4+
from confluent_kafka.avro.serializer import SerializerError
5+
6+
7+
class SerializerErrorTest(unittest.TestCase):
8+
9+
def test_message(self):
10+
try:
11+
raise SerializerError("message")
12+
except SerializerError as e:
13+
assert e.message == 'message'

0 commit comments

Comments
 (0)