5.8 Error Codes
5.8.1 RC0000
5.8.2 RE0000
5.8.3 RE0001
5.8.4 RE0002
5.8.5 RE0003
5.8.6 RE0004
5.8.7 RE0005
5.8.8 RE0006
5.8.9 RE0007
5.8.10 RE0008
5.8.11 RE0009
5.8.12 RE0010
5.8.13 RE0011
5.8.14 RE0012
5.8.15 RE0013
5.8.16 RE0014
5.8.17 RE0015
5.8.18 RE0016
5.8.19 RE0017
5.8.20 RE0018
5.8.21 RE0019
5.8.22 RE0020
5.8.23 RE0021
5.8.24 RE0022
5.8.25 RE0023
5.8.26 RE0024
5.8.27 RE0025
5.8.28 RE0026
5.8.29 RE0027
5.8.30 RE0028
5.8.31 RE0029
5.8.32 RE0030
5.8.33 RE0031
5.8.34 RE0032
5.8.35 RE0033
5.8.36 RE0034
5.8.37 RE0035
5.8.38 RE0036
5.8.39 RE0037
5.8.40 RE0038
5.8.41 RE0039
5.8.42 RE0040
5.8.43 RE0041
5.8.44 RE0042
5.8.45 RE0043
5.8.46 RE0044
5.8.47 RE0045
5.8.48 RE0046
5.8.49 RE0047
5.8.50 RE0048
5.8.51 RE0049
5.8.52 RE0050
5.8.53 RE0051
5.8.54 RE0052
5.8.55 RE0053
5.8.56 RE0054
5.8.57 RE0055
5.8.58 RE0056
5.8.59 RE0057
5.8.60 RE0058
5.8.61 RE0059
5.8.62 RE0060
5.8.63 RE0061
5.8.64 RE0062
5.8.65 RE0063
5.8.66 RE0064
5.8.67 RE0065
5.8.68 RE0066
5.8.69 RE0067
5.8.70 RE0068
5.8.71 RE0069
5.8.72 RE0070
5.8.73 RE0071
5.8.74 RE0072
5.8.75 RE0073
5.8.76 RE0074
5.8.77 RE0075
5.8.78 RE0076
5.8.79 RE0077
5.8.80 RE0078
5.8.81 RE0079
5.8.82 RE0080
5.8.83 RE0081
5.8.84 RE0082
5.8.85 RE0083
5.8.86 RE0084
5.8.87 RE0085
5.8.88 RE0086
5.8.89 RE0087
5.8.90 RE0088
5.8.91 RE0089
5.8.92 RE0090
5.8.93 RE0091
5.8.94 RE0092
5.8.95 RE0093
5.8.96 RE0094
5.8.97 RE0095
5.8.98 RE0096
5.8.99 RE0097
5.8.100 RE0098
5.8.101 RE0099
5.8.102 RE0100
5.8.103 RE0101
5.8.104 RE0102
5.8.105 RE0103
5.8.106 RE0104
5.8.107 RE0105
5.8.108 RE0106
5.8.109 RE0107
5.8.110 RE0108
5.8.111 RE0109
5.8.112 RE0110
5.8.113 RE0111
5.8.114 RE0112
5.8.115 RE0113
5.8.116 RE0114
5.8.117 REP0000
5.8.118 RI0000
5.8.119 RI0001
5.8.120 RI0002
5.8.121 RI0003
5.8.122 RI0004
5.8.123 RL0000
5.8.124 RP0000
5.8.125 RP0001
5.8.126 RP0002
5.8.127 RP0003
5.8.128 RP0004
5.8.129 RP0005
5.8.130 RP0006
5.8.131 RP0007
5.8.132 RP0008
5.8.133 RP0009
5.8.134 RP0010
5.8.135 RP0011
5.8.136 RX0000
5.8.102 RE0100

This error indicates that there are multiple throw statements inside a try block and the values thrown are of different Types.

You can fix this error by ensuring that every value thrown is of the same type. It may be necessary to create a new Data instance that can handle different types.

For example, the code below erroneously throws a UInt and a Bool:

Alice.only(() => {
  const transferAll = declassify(interact.transferAll);
});
Alice.publish(transferAll);

try {
  if (transferAll) {
    throw true;
  } else {
    throw 1;
  }
} catch (e) {
  if (e == true) {
    transfer(balance()).to(Alice);
  } else {
    transfer(e).to(Alice);
  }
}

You can fix this code by abstracting the Types of values thrown into a new Data type:

const TransferType = Data({
  CERTAIN_AMT: UInt,
  TRANSFER_ALL: Null
});

Alice.only(() => {
  const transferAll = declassify(interact.transferAll);
});
Alice.publish(transferAll);

try {
  if (transferAll) {
    throw TransferType.TRANSFER_ALL();
  } else {
    throw TransferType.CERTAIN_AMT(1);
  }
} catch (e) {
  switch (e) {
    case CERTAIN_AMT: {
      transfer(e).to(Alice);
    }
    case TRANSFER_ALL: {
      transfer(balance()).to(Alice);
    }
  }
}