FOLIO-FSE / folio_migration_tools

A Python module and CLI tool that transforms legacy ILS data into the native FOLIO formats and loads it into FOLIO
MIT License
11 stars 8 forks source link

Tools have hardcoded limit of only 50 errors #773

Closed banerjek closed 2 months ago

banerjek commented 2 months ago

I'm unable to build items for sulib because it's stopping after encountering 50 errors -- neither failedRecordsThreshold nor failedPercentageThreshold is respected. I can't think of any record type other than orders where 50 is a usable default so if a hard limit is assumed, 5K seems more appropriate. But that is still too low so configured failed threshold still need to be observed

Problem appears to be in mapper_base.py

def handle_generic_exception(self, idx, excepion: Exception): self.num_exeptions += 1 print("\n=======ERROR===========") print( f"Row {idx:,} failed with the following unhandled Exception: {excepion} " f"of type {type(excepion).__name__}" ) logging.error(excepion, exc_info=True) if self.num_exeptions > 50: logging.fatal( "Stopping. More than %s unhandled exceptions. Code needs fixing", self.num_exeptions, ) sys.exit(1)