Skip to content

Commit

Permalink
Merge pull request #14 from getwilds/bugsquash
Browse files Browse the repository at this point in the history
edited error handling in education
  • Loading branch information
realbp authored Feb 7, 2024
2 parents 9afe9db + df758e7 commit 0681c7d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/handle-education.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ handle_education <-function(education) {
)

edu_code <- edu_mapping[education]
print(edu_code)

if (is.null(edu_code)) {
stop("Invalid input")
if (is_na(edu_code)) {
stop("Invalid education input, please check the documentation for valid inputs")
}

return(as.character(edu_code))
}

0 comments on commit 0681c7d

Please sign in to comment.