mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-12-25 06:27:49 +01:00
build: improve error handling.
This commit is contained in:
parent
166e786166
commit
b342df689a
1 changed files with 5 additions and 2 deletions
|
@ -80,7 +80,10 @@ func Build() error {
|
|||
if !file.Exist() {
|
||||
continue
|
||||
}
|
||||
content, _ := file.ReadFile()
|
||||
content, err := file.ReadFile()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
profile := string(content)
|
||||
for _, fct := range Builds {
|
||||
profile = fct(profile)
|
||||
|
@ -89,7 +92,7 @@ func Build() error {
|
|||
profile = fct(file, profile)
|
||||
}
|
||||
if err := file.WriteFile([]byte(profile)); err != nil {
|
||||
panic(err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
printBuildMessage()
|
||||
|
|
Loading…
Reference in a new issue