Improved error handling
This commit is contained in:
parent
8de28852cd
commit
b72e3943a4
3 changed files with 10 additions and 15 deletions
|
@ -7,7 +7,6 @@ import (
|
|||
|
||||
"git.akyoto.dev/cli/q/src/compiler"
|
||||
"git.akyoto.dev/cli/q/src/elf"
|
||||
"git.akyoto.dev/cli/q/src/errors"
|
||||
)
|
||||
|
||||
// Build describes a compiler build.
|
||||
|
@ -26,16 +25,6 @@ func New(directory string) *Build {
|
|||
|
||||
// Run parses the input files and generates an executable file.
|
||||
func (build *Build) Run() error {
|
||||
stat, err := os.Stat(build.Directory)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !stat.IsDir() {
|
||||
return &errors.InvalidDirectory{Path: build.Directory}
|
||||
}
|
||||
|
||||
functions, err := compiler.Compile(build.Directory)
|
||||
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue