Skip to content

Commit

Permalink
Fix bad exception handling in cases of 0 CSVs in import ZIPs
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Oct 30, 2018
1 parent 0163cf9 commit 12182b3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions import.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ func handleImportSubscribers(c echo.Context) error {
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError,
fmt.Sprintf("Error extracting ZIP file: %v", err))
} else if len(files) == 0 {
return echo.NewHTTPError(http.StatusBadRequest, "No CSV files found to import.")
}
go impSess.LoadCSV(dir+"/"+files[0], rune(r.Delim[0]))

Expand Down

0 comments on commit 12182b3

Please sign in to comment.