github.com/primecitizens/pcz/std@v0.2.1/core/bits/errors.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  //
     4  // Copyright 2017 The Go Authors. All rights reserved.
     5  // Use of this source code is governed by a BSD-style
     6  // license that can be found in the LICENSE file.
     7  
     8  package bits
     9  
    10  import (
    11  	"github.com/primecitizens/pcz/std/core/cerr"
    12  )
    13  
    14  type error = cerr.E
    15  
    16  type ErrOverflow struct{}
    17  
    18  func (ErrOverflow) WriteErr(w cerr.Writer) int { return w.Write("overflow") }
    19  
    20  var _ error = ErrDivideByZero{}
    21  
    22  type ErrDivideByZero struct{}
    23  
    24  func (ErrDivideByZero) WriteErr(w cerr.Writer) int {
    25  	return cerr.WriteJoinS(w, " ", "divide", "by", "zero")
    26  }