some error handling

because twisted cannot do that properly