<div dir="ltr"><div><div><div>Thanks Konrad and Thomas for your inputs:<br><br></div>Having a NewSimpleError(..) looks like a better short-term solution than maintaining multiple copies of errors.go<br></div><br>- <br></div>Shoubhik<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 24, 2016 at 2:21 PM, Thomas Mäder <span dir="ltr"><<a href="mailto:tmader@redhat.com" target="_blank">tmader@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>There is also
<a class="gmail-m_1414399213328690062moz-txt-link-freetext" href="https://github.com/almighty/almighty-core/issues/100" target="_blank">https://github.com/almighty/<wbr>almighty-core/issues/100</a> related to
this.<br>
</p><div><div class="gmail-h5">
<br>
<div class="gmail-m_1414399213328690062moz-cite-prefix">On 10/24/2016 10:26 AM, Konrad Kleine
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi Shoubik,
<div><br>
</div>
<div>Thomas, Aslak and I discussed that at some point and one
possible solution would be to construct errors with methods
like NewSimpleError(), NewWhatEverError() that must be written
first.</div>
<div><br>
</div>
<div>I'm not sure what the outcome of our discussion was though.
It didn't seem extremely important back then.</div>
<div><br>
</div>
<div>Regards,</div>
<div>Konrad</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Oct 21, 2016 at 10:50 AM,
Shoubhik Bose <span dir="ltr"><<a href="mailto:shbose@redhat.com" target="_blank">shbose@redhat.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>
<div>Hi folks,<br>
<br>
</div>
In alm-core we have error types defined inside
models/errors.go<br>
<a href="https://github.com/almighty/almighty-core/blob/master/models/errors.go" target="_blank">https://github.com/almighty/al<wbr>mighty-core/blob/master/models<wbr>/errors.go</a><br>
<br>
To construct an error we do a :<br>
InternalError{<b>s</b>impleError{err.<span class="gmail-m_1414399213328690062m_-1573449498360598407gmail-pl-c1"><wbr>Error</span>()}}<br>
<br>
which means that we can't access these outside the
models package since simpleError is non-exported.<br>
<br>
</div>
What would be the recommended approach for defining and
using error types in other packages? <br>
<br>
Should the packages have their own errors.go , <br>
or <br>
should we modify models/errors.go to make it usable from
outside?<br>
<div>
<div><br>
<br>
<br>
--<br>
</div>
<div>Shoubhik<br>
</div>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
almighty-public mailing list<br>
<a href="mailto:almighty-public@redhat.com" target="_blank">almighty-public@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/almighty-public" rel="noreferrer" target="_blank">https://www.redhat.com/mailman<wbr>/listinfo/almighty-public</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div></div></div>
</blockquote></div><br></div></div></div>