Skip to content

Commit

Permalink
add missing errorhandling to functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Edru2 committed Mar 13, 2024
1 parent 2151cc1 commit 8fef749
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions KeyFunctions.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ func handleKeys(keys *[]Key, parentDir string) {

jsonFilePath := filepath.Join(parentDir, "keys.json")
jsonData, err := json.MarshalIndent(jsonFile, "", " ")
if err != nil {
panic(err)
}
err = os.WriteFile(jsonFilePath, jsonData, 0644)
if err != nil {
panic(err)
Expand Down
3 changes: 3 additions & 0 deletions ScriptFunctions.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ func handleScripts(scripts *[]Script, parentDir string) {

jsonFilePath := filepath.Join(parentDir, "scripts.json")
jsonData, err := json.MarshalIndent(jsonFile, "", " ")
if err != nil {
panic(err)
}
err = os.WriteFile(jsonFilePath, jsonData, 0644)
if err != nil {
panic(err)
Expand Down
3 changes: 3 additions & 0 deletions TimerFunctions.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ func handleTimers(timers *[]Timer, parentDir string) {

jsonFilePath := filepath.Join(parentDir, "timers.json")
jsonData, err := json.MarshalIndent(jsonFile, "", " ")
if err != nil {
panic(err)
}
err = os.WriteFile(jsonFilePath, jsonData, 0644)
if err != nil {
panic(err)
Expand Down
3 changes: 3 additions & 0 deletions TriggerFunctions.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ func handleTriggers(triggers *[]Trigger, parentDir string) {

jsonFilePath := filepath.Join(parentDir, "triggers.json")
jsonData, err := json.MarshalIndent(jsonFile, "", " ")
if err != nil {
panic(err)
}
err = os.WriteFile(jsonFilePath, jsonData, 0644)
if err != nil {
panic(err)
Expand Down

0 comments on commit 8fef749

Please sign in to comment.