Error gets the argument at the specified index. Panics if there is no argument, or if the argument is of the wrong type.
(index int)
| 1118 | // Error gets the argument at the specified index. Panics if there is no argument, or |
| 1119 | // if the argument is of the wrong type. |
| 1120 | func (args Arguments) Error(index int) error { |
| 1121 | obj := args.Get(index) |
| 1122 | var s error |
| 1123 | var ok bool |
| 1124 | if obj == nil { |
| 1125 | return nil |
| 1126 | } |
| 1127 | if s, ok = obj.(error); !ok { |
| 1128 | panic(fmt.Sprintf("assert: arguments: Error(%d) failed because object wasn't correct type: %v", index, obj)) |
| 1129 | } |
| 1130 | return s |
| 1131 | } |
| 1132 | |
| 1133 | // Bool gets the argument at the specified index. Panics if there is no argument, or |
| 1134 | // if the argument is of the wrong type. |