Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

log exception when bad link detected #69

Closed
wants to merge 1 commit into from

Conversation

VladaHejda
Copy link

When 404 occurred after pass through an anchor with referer on site self, it is probably bad link inside application self and not user's typo or search engine wrong index - it might be worth to send report.

@JanTvrdik
Copy link
Contributor

👎 too smart

@VladaHejda
Copy link
Author

and what about log that exception when just any referer exists?

@enumag
Copy link
Contributor

enumag commented Mar 1, 2015

Why log entire exception? We can just add the referer information to access.log.

@VladaHejda
Copy link
Author

but that 404 may be an error in application.. and who reads access log...

@enumag
Copy link
Contributor

enumag commented Mar 1, 2015

I do. And to prevent errors in application I use INVALID_LINK_EXCEPTION.

@VladaHejda
Copy link
Author

what if programmer self throws BadRequestException because of invalid input parameter:

function actionDefault($number) {
    if ($number > 3) {
        throw new BadRequestException;
    }
}

but <a n:href="this number => 5">link</a> is not invalid link...

@enumag
Copy link
Contributor

enumag commented Mar 1, 2015

That's exactly why I use this approach.

@dg
Copy link
Member

dg commented Mar 2, 2015

IMHO logging of 404 can be removed, it is usually done (in better way) by web server.

@VladaHejda
Copy link
Author

@enumag: actually I don't see how that approach can solve the issued problem.

@TomasVotruba
Copy link

Is there any way to merge this or should we close this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants