// Traverse all years and months
yearEntries, err := os.ReadDir(userDir)
if err != nil {
- http.Error(w, fmt.Sprintf("Error reading user directory: %v", err), http.StatusInternalServerError)
+ http.Error(w, "No logs found to be searched", http.StatusNotFound)
return
}
if username_from_file, ok := user["username"].(string); ok && strings.EqualFold(username_from_file, username) {
utils.Logger.Printf("Registration failed. Username '%s' already exists", username)
- return false, fmt.Errorf("username already exists: %d", http.StatusBadRequest)
+ return false, fmt.Errorf("username already exists (error %d)", http.StatusBadRequest)
}
}
}
file, err := os.Open(filePath)
if err != nil {
if os.IsNotExist(err) {
- Logger.Printf("%s - File not found", filePath)
return map[string]any{}, nil
}
Logger.Printf("Error opening %s: %v", filePath, err)
file, err := os.Open(filePath)
if err != nil {
if os.IsNotExist(err) {
- Logger.Printf("%s - File not found", filePath)
return "", nil
}
Logger.Printf("Error opening %s: %v", filePath, err)
})
.catch((error) => {
$searchResults = [];
- console.error(error);
+ console.error(error.response.data);
$isSearching = false;
// toast
</div>
{#if !registration_allowed}
<div class="alert alert-danger" role="alert">
- {t('login.alert.registration_not_allowed')}
+ {$t('login.alert.registration_not_allowed')}
</div>
{/if}
{#if show_registration_failed_with_message}
<div class="alert alert-danger" role="alert">
- {@html (t('login.alert.registration_failed_with_message'),
- {
+ {@html $t('login.alert.registration_failed_with_message', {
message: registration_failed_message
})}
</div>