Skip to content

Improve exception handling in model loading - #1

Open
felixkamau wants to merge 1 commit into
patrickloeber:mainfrom
felixkamau:file-handling
Open

Improve exception handling in model loading#1
felixkamau wants to merge 1 commit into
patrickloeber:mainfrom
felixkamau:file-handling

Conversation

@felixkamau

Copy link
Copy Markdown

This pull request enhances the exception handling in the code responsible for loading data from 'saved_steps.pkl'. The improvements include the use of specific exception types for better error diagnosis and more informative error messages. Additionally, optional raise statements have been added to propagate exceptions for further analysis if desired.

Changes Made

  • Used specific exception types (FileNotFoundError, pickle.PickleError, KeyError) for targeted error handling.
  • Provided more informative error messages to guide users in case of a FileNotFoundError or specific issues during data loading.
  • Optionally added raise statements to propagate exceptions for better debugging if needed.

Testing

The changes have been tested with both existing and non-existing 'saved_steps.pkl' files to ensure appropriate handling of different scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant