Laravel - how to show errors on terminal rather than log file? - laravel

I'm watching TDD by Example Laracast and I see whenever he runs phpunit and a fatal error or an uncaught exception is thrown, it gets logged in the terminal like this:
MyControllerTest::test_it_shows_create_form
InvalidArgumentException: View [mycontroller.create] not found
But whenever I run phpunit and get a fatal error or an uncaught exception, it just get logged directly to storage/logs/laravel.log instead of showing it in the terminal, which makes it harder and slower to do TDD.
Is there a configuration I might be missing that's causing me this issue?
Edit:
My console outputs this
MyControllerTest::test_it_shows_create_form
Failed to assert 200 equals 500
The failed assertion is a $this->assertResponseOk(), and since something is wrong (an uncaught exception maybe) http response code is 500.
But as you can see, it won't show me what the error is

Testing with PHPUnit, Behat, etc. runs your application in a different environment. So basically you should enable debugging for the environment that your test suite is using. If I recall correctly, test suites run your application in the testing environment. In that case you should create a .env.testing file in your root directory and enable debug option there.

Related

Getting Hydration Failed errors in shopify when building the first app

I am learning how to code an Shopify app. I wanted to build first app and I started following this tutorial : https://shopify.dev/apps/getting-started/create
I used npm init #Shopify/app#latest to create first app, then moved to that directory using cd .\first-app\ then I used npm run dev App looks and works fine with UI but on console I am getting lots of errors. Here are few of them.
Hydration failed because the initial UI does not match what was rendered on the server.
There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.
vendors-node_modules_bugsnag_js_browser_notifier_js-node_modules_shopify_monorail_lib_monorai-fdaebc-b7c7bc61031d801d7cdf29f30133708999e0fe454a161247422ecc3e28c64ef8.js:2
Uncaught (in promise) Error: Error completing request. A network failure may have prevented the request from completing. Error: TypeError: Failed to fetch
And few more, I did set up the ngrok tunnel and it is working fine.
I might be missing something, any help or pointing me to right direction is appriciated
Trying to build my first app on Shopify going through their documentation using : https://shopify.dev/apps/getting-started/create

Getting a weird error in Cypress and unsure what's causing it?

I'm getting this error in Cypress:
[14884:0531/191841.692335:ERROR:system_services.cc(34)] SetApplicationIsDaemon: Error Domain=NSOSStatusErrorDomain Code=-50 "paramErr: error in user parameter list" (-50
Looked it up and can't find information anywhere specific to Cypress, does anyone know what's causing it?
It's not failing my tests, but it's making the build in circleci show a failure :(
Thanks,
Not sure of your config setup but if it's using the default Electron browser I usually get this error. If i change to browser: "chrome" in cypress.run this error message disappears.

SwiftUI previews error: Connecting to launched interactive agent

I received the above error when using the SwiftUI previews feature and can't figure out why this happens. The error always looks something like this:
GenericHumanReadableError: unexpected error occurred
messageRepliedWithError("Connecting to launched interactive agent 1894", Optional(Error Domain=com.apple.dt.xcodepreviews.service Code=17 "connectToPreviewHost: Failed to connect to 1894: (null)" UserInfo={NSLocalizedDescription=connectToPreviewHost: Failed to connect to 1894: (null)}))
I managed to figure out a good way to debug this, please see below
If you head into /Users/USERNAME/Library/Logs/DiagnosticReports you will see the latest crash reports. Open the most recent one (should start with your app name), and it should tell you the reason the app crashed. It'll look something like this:
Application Specific Information:
Fatal error: This request requires an authenticated account: file /Users/USERNAME/Work/AppName/Models/CloudKitAlbumManager.swift, line 101
In my case, it was a fatalError i threw in development for debugging. The previews loads your app and thus call your whole stack and will crash if you like me throws fatalErrors for debugging.
I hope this helps

IIS 10 Failed Request 500 - General_Request_Start Failed To Complete

I'm trying to understand why after deployment my server is returning 500 - Internal server error for a simple GET request that checks the server's status which is supposed to return 200 (when I run it locally with unit tests I wrote, it works fine). I retrieved the failed request log, but can't quite seem to understand what the problem is.
In several events the severity column shows: Failed To Complete
The Request summary shows:
These are the Errors and Warnings shown:
Does anyone know why I might be getting theses errors, or why I might be getting a 500 Internal Server error response?
I will add that I already have a GET request that is working:
https://myalertsserver.cloudapp.net/providers/management/alerts which returns 200.
and when I try:
https://myalertsserver.cloudapp.net/providers/status I get a 404 Error.
It seems to me like it has to do with something in the configuration, but I can't seem to understand what.
Thanks in advance.

How to log errors when Play Evolutions fail?

I am just getting started with Play Evolutions and I find it pretty tough to figure out why they fail and leave the DB in an inconsistent state.
In Dev mode it will display the error in the default HTML page but it does not say which statement failed. This is also problematic since for this particular application I only have REST APIs that return JSON and so an HTML error is not appropriate. I have my own error handler so I will probably end up matching on ExceptionAttachment and pull out the content/script myself and escape that in the JSON error response. However this is only in DEV mode since I would not want this going back to a real user in PROD.
More frustrating is that it doesn't even log the statement when it fails. I can enable logging for my driver but once the failure has occurred it is too late to then go and enable logging.
Is there anyway to get a more specific error in the logs when an evolution fails?

Resources