buruzaemon / natto

A Tasty Ruby Binding with MeCab
BSD 2-Clause "Simplified" License
143 stars 16 forks source link

Do not conceal original error in `parse_tostr` and `parse_tonodes` #73

Closed pocke closed 5 years ago

pocke commented 5 years ago

Problem

parse_tostr and parse_tonodes conceal errors when not mecab error is occurred in these methods.

Solution

Raise the original error if lattice strerror is empty.

Another approach

Probably specifying error class(es) in rescue is better approach, but I'm not sure which error classes are raised. So I gave up the approach.

buruzaemon commented 5 years ago

Thank you for raising this particular issue, @pocke.

Would you be able to provide an example of such a case, maybe wrapped up in a test case?

pocke commented 5 years ago

Would you be able to provide an example of such a case, maybe wrapped up in a test case?

Sure! I'll add a test case.

pocke commented 5 years ago

I added test cases for this in deca242.