Skip to content

Fail elegantly when expected database schema is missing #31

@hectcastro

Description

@hectcastro

If the database is offline or the schema is not setup properly, the service crashes hard:

panic: pq: relation "treemap_itreecodeoverride" does not exist

goroutine 1 [running]:
runtime.panic(0x6b6160, 0xc2104537e0)
    /usr/local/go/src/pkg/runtime/panic.c:266 +0xb6
main.main()
    /var/jenkins/workspace/OTM2_Build_Release/cloudbuild/go/src/github.com/azavea/ecobenefits/main.go:140 +0x3b2

goroutine 3 [runnable]:
database/sql.(*DB).connectionOpener(0xc210154380)
    /usr/local/go/src/pkg/database/sql/sql.go:574 +0x3e
created by database/sql.Open
    /usr/local/go/src/pkg/database/sql/sql.go:436 +0x24d

goroutine 4 [syscall]:
runtime.goexit()
    /usr/local/go/src/pkg/runtime/proc.c:1394

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions