Code Monkey home page Code Monkey logo

Comments (8)

Jordan-Nelson avatar Jordan-Nelson commented on July 26, 2024 1

@joaoantoniomartinsfilho You are not missing anything. That looks like unexpected behavior. We will see if we can reproduce it.

from amplify-flutter.

Jordan-Nelson avatar Jordan-Nelson commented on July 26, 2024 1

Hello @joaoantoniomartinsfilho - This does appear to be a bug. The exception is not getting mapped correctly. e should be type UserLambdaValidationException, not LambdaException.

The reason that you are not able to type check the underlying exception is that there are actually two UserLambdaValidationException types. One is public and extends AmplifyException. The other is private and is only intended to be used internally. The underlying exception is the private/internal one. However, if e was the correct type you would not need to check the type of e.underlyingException

Thanks for raising the issue. I will look into a fix and let you know when we have an update.

from amplify-flutter.

Jordan-Nelson avatar Jordan-Nelson commented on July 26, 2024 1

@jmartins-sh - This issue was addressed in Amplify Flutter v2 which was released a couple weeks ago. There were some breaking changes in this version. Please see the upgrade guide for more info.

from amplify-flutter.

Jordan-Nelson avatar Jordan-Nelson commented on July 26, 2024

Hello @joaoantoniomartinsfilho

_$UserLambdaValidationException extends UserLambdaValidationException. Here is the class definition. It is an internal class used for json serialization with built_value.

If you want to check if the exception is a UserLambdaValidationException you can do the following.

if (e is UserLambdaValidationException) {
  // handle exception 
}

Let me know if you have any other questions.

from amplify-flutter.

jmartins-sh avatar jmartins-sh commented on July 26, 2024

Hey @Jordan-Nelson, how's it going?

Thanks for the reply.

Do you mean checking directly the underlying exception, instead of the runtime type?

from amplify-flutter.

jmartins-sh avatar jmartins-sh commented on July 26, 2024

Hey @Jordan-Nelson , I followed your suggestion, but even after that, the comparison using the is operator with underlyingException is returning false, as you can check in the screenshot below.

Did I misunderstand something, or is there something else I need to consider?

image

from amplify-flutter.

jmartins-sh avatar jmartins-sh commented on July 26, 2024

Hey @Jordan-Nelson, thanks for the reply.

I just have one more question, is the lib amplify-flutter independent of Amplify Gen 2 right? Or Am I getting this wrong? My project is currently running in Amplify Gen 1 (amplify-cli and cloud). Will we face any issues using the lib 2.0?

Appreciate it.

from amplify-flutter.

Jordan-Nelson avatar Jordan-Nelson commented on July 26, 2024

Hi @jmartins-sh - Amplify Flutter v2 is compatible with Amplify Gen 1 and Amplify Gen 2.

from amplify-flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.