Can't really answer that.. would need to see the whole transform() & transformOnError() function you have. In general, onError() is called when exception is raised in transform(). If your transformOnError() returns SKIP (constant), then current record is skipped and processing continues with the next one. If you return ALL, then whatever was already written to $out. is sent out (means can be partially updated output record). Of course, you can abort the whole processing inside transformOnError() if you return negative number or call raiseError() function.
Hope this explains it a bit.