Confusing error messages on send
Error messages from send
can be misleading, e.g.,:
In [35]: producer.send(1, "processed/foo.txt", b"foo", user_meta=meta)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
asapo_producer.pyx in asapo_producer._bytes()
TypeError: Could not convert to unicode.
Exception ignored in: 'asapo_producer.PyProducer.create_message_header'
Traceback (most recent call last):
File "asapo_producer.pyx", line 39, in asapo_producer._bytes
TypeError: Could not convert to unicode.
---------------------------------------------------------------------------
AsapoWrongInputError Traceback (most recent call last)
<ipython-input-35-4f162d4a704b> in <module>
----> 1 producer.send(1, "processed/foo.txt", b"foo", user_meta=meta)
asapo_producer.pyx in asapo_producer.PyProducer.send()
asapo_producer.pyx in asapo_producer.PyProducer.__send_bytes()
asapo_producer.pyx in asapo_producer.throw_exception()
AsapoWrongInputError: error: wrong input, message: empty filename
The problem here is that meta
is a dictionary and not a string.
The same misleading error message can also be triggered like this:
In [36]: producer.send(1, "processed/foo.txt", b"foo", print)
...
AsapoWrongInputError: error: wrong input, message: empty filename
Here, the problem is that callback=print
is needed instead.