Error handling

Handling errors in ast