Skip to content

Commit b92150e

Browse files
author
Dorian Stoll
committedMar 19, 2017
Dont try to crash the application on purpose
1 parent df5062f commit b92150e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed
 

‎src/SpaceDock/utils/arrays.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func ArrayContainsRe(itr []string, value string) bool {
4343
r,err := regexp.Compile(element)
4444

4545
if err != nil {
46-
log.Fatalf("Invalid regular expression detected: %s", value)
46+
log.Printf("Invalid regular expression detected: %s", value)
4747
return false
4848
}
4949

‎src/SpaceDock/utils/context.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func GetFullJSON(ctx *iris.Context) map[string]interface{} {
1717
var value map[string]interface{}
1818
err := ctx.ReadJSON(&value)
1919
if err != nil {
20-
log.Fatal("Tried to parse invalid JSON")
20+
log.Print("Tried to parse invalid JSON")
2121
return nil
2222
}
2323
return value

‎src/SpaceDock/utils/email.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func SendMail(sender string, recipients []string, subject string, message string
3939
sc,err := srv.Dial()
4040
defer sc.Close()
4141
if err != nil {
42-
log.Fatalf("Error while sending mail: %s", err)
42+
log.Printf("Error while sending mail: %s", err)
4343
return
4444
}
4545
sc.Send(sender, recipients, m)
@@ -49,7 +49,7 @@ func SendMail(sender string, recipients []string, subject string, message string
4949
func SendConfirmation(userConfirmation string, userUsername string, userEmail string, followMod string) {
5050
buffer,err := ioutil.ReadFile("emails/confirm-account")
5151
if err != nil {
52-
log.Fatalf("Error while reading Email Template confirm-account: %s", err)
52+
log.Printf("Error while reading Email Template confirm-account: %s", err)
5353
return
5454
}
5555
confirmation := userConfirmation
@@ -66,7 +66,7 @@ func SendConfirmation(userConfirmation string, userUsername string, userEmail st
6666
t := template.Must(template.New("email").Parse(text))
6767
buf := &bytes.Buffer{}
6868
if err := t.Execute(buf, data); err != nil {
69-
log.Fatalf("Error while parsing Email Template confirm-account: %s", err)
69+
log.Printf("Error while parsing Email Template confirm-account: %s", err)
7070
return
7171
}
7272
s := buf.String()
@@ -76,7 +76,7 @@ func SendConfirmation(userConfirmation string, userUsername string, userEmail st
7676
func SendReset(userUsername string, userPasswordReset string, userEmail string) {
7777
buffer,err := ioutil.ReadFile("emails/password-reset")
7878
if err != nil {
79-
log.Fatalf("Error while reading Email Template password-reset: %s", err)
79+
log.Printf("Error while reading Email Template password-reset: %s", err)
8080
return
8181
}
8282
data := map[string]interface{}{
@@ -89,7 +89,7 @@ func SendReset(userUsername string, userPasswordReset string, userEmail string)
8989
t := template.Must(template.New("email").Parse(text))
9090
buf := &bytes.Buffer{}
9191
if err := t.Execute(buf, data); err != nil {
92-
log.Fatalf("Error while parsing Email Template password-reset: %s", err)
92+
log.Printf("Error while parsing Email Template password-reset: %s", err)
9393
return
9494
}
9595
s := buf.String()

0 commit comments

Comments
 (0)
Please sign in to comment.