~mendelmaleh/pfin

6b408c967e8864ab5e2d9d0b1049f2dc47185f7c — Mendel E 17 days ago 80671e9 master
Wrap parser error with account and filename
1 files changed, 6 insertions(+), 1 deletions(-)

M parser.go
M parser.go => parser.go +6 -1
@@ 26,7 26,12 @@ func Parse(acc Account, filename string, data []byte) ([]Transaction, error) {
		return []Transaction{}, ErrUnregisteredParser{acc.Type}
	}

	return parsers[acc.Type].Parse(acc, filename, data)
	txns, err := parsers[acc.Type].Parse(acc, filename, data)
	if err != nil {
		return []Transaction{}, fmt.Errorf("error parsing %s/%s: %w", acc.Name, filename, err)
	}

	return txns, nil
}

func Filetype(parser string) (string, error) {