[almighty] Code re-factoring for accessing the errors package in alm-core

Shoubhik Bose shbose at redhat.com
Fri Oct 21 08:50:30 UTC 2016


Hi folks,

In alm-core we have error types defined inside models/errors.go
https://github.com/almighty/almighty-core/blob/master/models/errors.go

To construct an error we do a :
InternalError{*s*impleError{err.Error()}}

which means that we can't access these outside the models package since
simpleError is non-exported.

What would be the recommended approach for defining and using error types
in other packages?

Should the packages have their own errors.go ,
or
should we modify models/errors.go to make it usable from outside?



--
Shoubhik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/almighty-public/attachments/20161021/7f6beaed/attachment.htm>


More information about the almighty-public mailing list