Skip to content

stop_on_error should be default true #705

@yelodevopsi

Description

@yelodevopsi

It seems that the default [build].stop_on_error param (if not defined in .air.toml) is set to false?

Is there any particular reason for it?

I just ended up debugging for 3+ hours where the build seemingly worked ok, until I dug deeper in my verbose output log.
Using the "last known working binary" for hot-realoading and run it should not be the default imho.

Can this be changed? Thanks.

here's my current .air.toml if it is relevant.

# .air.toml

# Root directory
root = "."
tmp_dir = "tmp"

[build]
  # Command to build your project
  # Use .exe extension for Windows
  cmd = "swag init --parseDependency --parseInternal --parseDepth 1 && go build -o ./tmp/main.exe"

  # File extensions to watch for changes
  include_ext = ["go", "tpl", "tmpl", "html", "css", "js"]

  # Directories to exclude from watching
  exclude_dir = ["assets", "tmp", "vendor", "docs"]

  # Delay rebuild until changes have settled (in milliseconds)
  delay = 1000

  # Additional build flags (optional)
  build_flags = "-v"

  # Add this line to stop running the app on build error
  stop_on_error = true

[run]
  # Command to run your built binary
  # Use .exe extension for Windows
  cmd = "./tmp/main.exe"

  # Environment variables to set when running the binary
  env = ["APP_ENV=development"]

[color]
  main = "yellow"
  watcher = "cyan"
  build = "green"
  runner = "magenta"
  

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions