astrodbtoolkit / astrodbtoolkit/astrodb_utils

Consistent use of the `raise_error` argument

Open
#67 1 comment 0 reactions 0 assignees View on GitHub
dev-docs
Dominant language
Python
Stars
0
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Ingest functions should have a `raise_error = True` argument. This gives the user the option to skip over problems and keep ingesting rather than have the code break frequently. This is currently being implemented like this:

```Python
except Exception as error_message:
msg = f"Something went wrong"
logger.debug(f"{error_message}")
if raise_error:
logger.error(msg)
raise AstroDBError(msg)
else:
logger.warning(msg)
return False # or continue
```
Let`s try to use this structure as consistently as possible.
Send the full error to debug. If raise_error = True, send custom message to error, else if raise_error = False, send it as a warning.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.