diff --git a/internal/service/filegenerator/filegenerator.go b/internal/service/filegenerator/filegenerator.go index 8e96824..9fbdb02 100644 --- a/internal/service/filegenerator/filegenerator.go +++ b/internal/service/filegenerator/filegenerator.go @@ -60,7 +60,7 @@ func (s *Service) GenerateFile(out iotools.Out, path string, args types.KeyValue func (s *Service) writeFile(content, path string) error { if err := s.fileWriter.WriteFile(path, content); err != nil { - return fmt.Errorf("%w at '%s': %w", ErrWritingFile, path, err) + return fmt.Errorf("file path: %s, %w: %w", path, err, ErrWritingFile) } return nil diff --git a/internal/service/scaffold/options.go b/internal/service/scaffold/options.go index 5ead33f..405e085 100644 --- a/internal/service/scaffold/options.go +++ b/internal/service/scaffold/options.go @@ -72,7 +72,7 @@ func (opts Options) validateDirectory() error { func (opts Options) validateModuleName() error { if err := validation.ValidateModuleName(opts.ModuleName); err != nil { - return fmt.Errorf("opts.ModuleName: %w: %w", commonerrors.ErrInvalidOption, err) + return fmt.Errorf("opts.ModuleName: %w", err) } return nil