{"record":{"id":"60d9c50fd004eb31","repo":"crewAIInc/crewAI","slug":"join-errors","errorCode":null,"errorMessage":"\"; \".join(errors)","messagePattern":"\"; \"\\.join\\(errors\\)","errorType":"validation","errorClass":"FileValidationError","httpStatus":null,"severity":"error","filePath":"lib/crewai-files/src/crewai_files/processing/processor.py","lineNumber":135,"sourceCode":"            The processed file (possibly transformed) or a sequence of files\n            if the file was chunked.\n\n        Raises:\n            FileProcessingError: If file.mode is STRICT and processing fails.\n        \"\"\"\n        if self.constraints is None:\n            return file\n\n        mode = self._get_mode(file)\n\n        try:\n            errors = self.validate(file)\n\n            if not errors:\n                return file\n\n            if mode == FileHandling.STRICT:\n                raise FileValidationError(\"; \".join(errors), file_name=file.filename)\n\n            if mode == FileHandling.WARN:\n                for error in errors:\n                    logger.warning(error)\n                return file\n\n            if mode == FileHandling.AUTO:\n                return self._auto_process(file)\n\n            if mode == FileHandling.CHUNK:\n                return self._chunk_process(file)\n\n            return file\n\n        except (FileValidationError, FileTooLargeError, UnsupportedFileTypeError):\n            raise\n        except Exception as e:\n            logger.error(f\"Error processing file '{file.filename}': {e}\")","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-files/src/crewai_files/processing/processor.py#L117-L153","documentation":"The FileProcessor in STRICT mode collects all constraint violations (size, format, dimensions, duration) via validate() and, if any are found, raises FileValidationError with all messages joined by '; '. STRICT means 'fail on limit breach' (vs WARN which logs, AUTO which resizes/compresses, CHUNK which splits), so this error reports the concrete violations, e.g. image too large or wrong MIME type.","triggerScenarios":"Processing a file whose constraints validation returns one or more errors while FileHandling.STRICT is set: oversized image, unsupported format, width beyond max_width, audio longer than max_duration_seconds, PDF over max_pages, etc.","commonSituations":"Defaulting to STRICT in production to guarantee provider limits are honored, then feeding user-uploaded files that exceed max_size_bytes; leaving max_width/max_height unset in a shared constraints object so another team's tight limits apply; uploading phone photos (4000px+) against a 2048px constraint.","solutions":["Read the '; '-joined messages: each segment names the exact violation (size/format/dimension/duration) — fix that condition.","Switch handling to FileHandling.AUTO so the processor resizes/compresses files to fit constraints automatically.","Use FileHandling.WARN during development to see violations without aborting.","Use FileHandling.CHUNK for oversized PDFs so they are split into page-range chunks."],"exampleFix":"# before\nprocessor = FileProcessor(constraints=ImageConstraints(...), handling=FileHandling.STRICT)\nout = processor.process(image_file)  # FileValidationError if any limit exceeded\n\n# after\nprocessor = FileProcessor(constraints=ImageConstraints(...), handling=FileHandling.AUTO)\nout = processor.process(image_file)  # auto-resized to fit limits","handlingStrategy":"try-catch","validationCode":"errors = processor.validate(file)\nif errors:\n    logger.warning(\"validation issues for %s: %s\", file.filename, \"; \".join(errors))\n    # decide: reject, or switch handling mode","typeGuard":null,"tryCatchPattern":"from crewai_files.processing.exceptions import FileValidationError\n\ntry:\n    out = processor.process(file)\nexcept FileValidationError as e:\n    logger.error(\"file %s rejected: %s\", e.file_name, e)\n    rejected.append(file)","preventionTips":["Run validate() (non-raising) first and log the error list instead of relying on STRICT exceptions.","Use AUTO/WARN in interactive flows and STRICT only in batch validation jobs.","Keep constraint objects per integration rather than one global set."],"tags":["validation","constraints","strict-mode","file-processing"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}