Mercurial > gemma
comparison pkg/common/errors.go @ 1224:bc4b642c8d04
Started with an upload sounding result to temp upload area.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 19 Nov 2018 17:14:42 +0100 |
parents | |
children | 6a021108410b |
comparison
equal
deleted
inserted
replaced
1223:a20fcfacda98 | 1224:bc4b642c8d04 |
---|---|
1 // This is Free Software under GNU Affero General Public License v >= 3.0 | |
2 // without warranty, see README.md and license for details. | |
3 // | |
4 // SPDX-License-Identifier: AGPL-3.0-or-later | |
5 // License-Filename: LICENSES/AGPL-3.0.txt | |
6 // | |
7 // Copyright (C) 2018 by via donau | |
8 // – Österreichische Wasserstraßen-Gesellschaft mbH | |
9 // Software engineering by Intevation GmbH | |
10 // | |
11 // Author(s): | |
12 // * Sascha L. Teichmann <sascha.teichmann@intevation.de> | |
13 | |
14 package common | |
15 | |
16 import ( | |
17 "errors" | |
18 "fmt" | |
19 "strings" | |
20 ) | |
21 | |
22 func ToError(errs []error) error { | |
23 var b strings.Builder | |
24 for i, err := range errs { | |
25 if i > 0 { | |
26 fmt.Fprintf(&b, ", ") | |
27 } | |
28 fmt.Fprintf(&b, "%v", err) | |
29 } | |
30 return errors.New(b.String()) | |
31 } |