Skip to content

Panic when required argument was not defined #59

@srevinsaju

Description

@srevinsaju
0002 • [module.deploy]
panic: /tmp/togomak790217308/modules/deploy/variables.hcl:5,31-31: Missing required argument; The argument "key" is required, but no definition was found.

goroutine 32 [running]:
github.com/srevinsaju/togomak/v1/internal/blocks/data.Variables({0x1a9a1c0, 0xc0013114a0}, {0x1a93d50, 0xc0012e53f0})
        /home/srev/src/github.com/srevinsaju/togomak/internal/blocks/data/provider.go:62 +0x1fa
github.com/srevinsaju/togomak/v1/internal/ci.(*Data).Variables(0xc001334f78)
        /home/srev/src/github.com/srevinsaju/togomak/internal/ci/data_hcl.go:16 +0xff
github.com/srevinsaju/togomak/v1/internal/ci.GraphTopoSort(0xc000191b80, 0xc0010d9d00)
        /home/srev/src/github.com/srevinsaju/togomak/internal/ci/graph.go:94 +0x85b
github.com/srevinsaju/togomak/v1/internal/ci.(*Pipeline).Run(0xc000191b80?, 0xc000191b80)
        /home/srev/src/github.com/srevinsaju/togomak/internal/ci/pipeline_run.go:66 +0x565
github.com/srevinsaju/togomak/v1/internal/ci.(*Module).run(0xc001188fc0, 0xc000cf4c60, {0xc0000481e0, 0x4d}, 0xc00172ca50, {0xc00158b010, 0x2, 0x2})
        /home/srev/src/github.com/srevinsaju/togomak/internal/ci/module_run.go:238 +0x105a
github.com/srevinsaju/togomak/v1/internal/ci.(*Module).Run(0xc001188fc0, 0xc000cf4c60, {0xc00158b010, 0x2, 0x2})
        /home/srev/src/github.com/srevinsaju/togomak/internal/ci/module_run.go:82 +0xa56
github.com/srevinsaju/togomak/v1/internal/ci.BlockRunWithRetries(0x0?, {0xc000014d00, 0xd}, {0x1a9f640, 0xc001188fc0}, 0xc000cf8460, {0x1acd760?, 0xc000cc4800?}, {0xc00158b010, 0x2, ...})
        /home/srev/src/github.com/srevinsaju/togomak/internal/ci/run.go:16 +0x143
created by github.com/srevinsaju/togomak/v1/internal/ci.(*Pipeline).Run in goroutine 1
        /home/srev/src/github.com/srevinsaju/togomak/internal/ci/pipeline_run.go:127 +0xcf

we should be providing a good error message instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions