Advertisement
Guest User

Untitled

a guest
Oct 18th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 1.17 KB | None | 0 0
  1. def builder(ex: ErrorDeserializingProgramOutput): TagMod = {
  2.     div(Styles.danger, key := ex.toString.hashCode,
  3.       ex.eliminate(renderDeserializationError,
  4.         _.eliminate(renderQQRuntimeException,
  5.           _.eliminate(renderQQCompilerException,
  6.             _.eliminate(renderParsingException,
  7.               _.eliminate(renderBase64Exception,
  8.                 _.eliminate(renderBytecodeException,
  9.                   _.impossible)))))))
  10.   }
  11.  
  12.   def renderDeserializationError(err: Invalid.Data): TagMod = {
  13.     "Error deserializing output from QQ program: " + err
  14.   }
  15.  
  16.   def renderBytecodeException(err: InvalidBytecode): TagMod = {
  17.     "Error getting QQ program from cache (bytecode): TagMod: " + err
  18.   }
  19.  
  20.   def renderBase64Exception(err: InvalidBase64): TagMod = {
  21.     "Error getting QQ program from cache (base64): " + err
  22.   }
  23.  
  24.   def renderParsingException(err: ParseError): TagMod = {
  25.     "Error parsing QQ program: " + err
  26.   }
  27.  
  28.   def renderQQCompilerException(err: QQCompilationException): TagMod = {
  29.     "Error compiling QQ program: " + err
  30.   }
  31.  
  32.   def renderQQRuntimeException(err: QQRuntimeException): TagMod = {
  33.     "Error running QQ program: " + err
  34.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement