make sure an error is set before printing it
Merge pull request #287 from satta/addintrons-debug

make sure an error is set before printing it
update error message
cosmetics
add class(es) for sorted set of distinct numbers
use generated code instead of makros